Get-EntraDirectoryRoleMember

Gets members of a directory role.

Syntax

Get-EntraDirectoryRoleMember
   -DirectoryRoleId <String>
   [-Property <String[]>]
   [<CommonParameters>]

Description

The Get-EntraDirectoryRoleMember cmdlet retrieves the members of a directory role in Microsoft Entra ID. To obtain the members of a specific directory role, specify the DirectoryRoleId. Use the Get-EntraDirectoryRole cmdlet to get the DirectoryRoleId value.

Examples

Example 1: Get members by role ID

Connect-Entra -Scopes 'RoleManagement.Read.Directory'
Get-EntraDirectoryRoleMember -DirectoryRoleId '67efd1ad-1046-4fb8-bb57-1d2e4f66c74e'

Id                                   DeletedDateTime
--                                   ---------------
bbbbbbbb-7777-8888-9999-cccccccccccc

This example retrieves the members of the specified role.

  • -DirectoryRoleId parameter specifies directory role ID.

Parameters

-DirectoryRoleId

Specifies the ID of a directory role in Microsoft Entra ID.

Type:System.String
Aliases:ObjectId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Property

Specifies properties to be returned.

Type:System.String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False