Remove-EntraDirectoryRoleMember
Removes a member of a directory role.
Syntax
Remove-EntraDirectoryRoleMember
-DirectoryRoleId <String>
-MemberId <String>
[<CommonParameters>]
Description
The Remove-EntraDirectoryRoleMember
cmdlet removes a member from a directory role in Microsoft Entra ID.
Examples
Example 1: Remove a member from a directory role
Connect-Entra -Scopes 'RoleManagement.ReadWrite.Directory'
$params = @{
DirectoryRoleId = 'aaaabbbb-0000-cccc-1111-dddd2222eeee'
MemberId = '11bb11bb-cc22-dd33-ee44-55ff55ff55ff'
}
Remove-EntraDirectoryRoleMember @params
This example removes the specified member from the specified role.
-DirectoryRoleId
- specifies the unique identifier (ObjectId) of the directory role from which the member will be removed.-MemberId
- specifies the unique identifier (MemberId) of the member (user, group, or service principal) that is to be removed from the specified directory role.
Parameters
-DirectoryRoleId
Specifies the object 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 |
-MemberId
Specifies the object ID of a role member.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |