microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Get-MgDirectoryRoleMember should allow to filter by role template ID

Open
#1,873 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dependency: OpenApi Request: Feature Service issue
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Currently, Get-MgDirectoryRoleMember only allows to filter by Directory Role ID:

   -DirectoryRoleId <String>

However, the underlying Graph API endpoint also allows to filter directly by Role Template ID:

You can use both the object ID and template ID of the directoryRole with this API. The template ID of a built-in role is immutable and can be seen in the role description on the Azure portal. For details, see Role template IDs.

It would be nice to have this possibility directly in Get-MgDirectoryRoleMember:

   -DirectoryRoleTemplateId <String>

It would avoid having to combine Get-MgDirectoryRole then Get-MgDirectoryRoleMember, like this:

$dirsync = Get-MgDirectoryRole -Filter "RoleTemplateId eq 'd29b2b05-8046-44ba-8758-1e26182fcf32'"
Get-MgDirectoryRoleMember -DirectoryRoleId $dirsync.Id

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Get-MgDirectoryRoleMember and Get-MgDirectoryRole entry points and compare their parameters with the Microsoft Graph directoryrole-list-members endpoint documentation. Done means Get-MgDirectoryRoleMember accepts -DirectoryRoleTemplateId and retrieves members directly by role template ID without first calling Get-MgDirectoryRole.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api, authorization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.