Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Remove-EntraBetaScopedRoleMembership

Removes a scoped role membership.

Syntax

Default (Default)

Remove-EntraBetaScopedRoleMembership

 -AdministrativeUnitId <String>
 -ScopedRoleMembershipId <String>
 [<CommonParameters>]

Description

The Remove-EntraBetaScopedRoleMembership cmdlet removes a scoped role membership from Microsoft Entra ID. Specify AdministrativeUnitId and ScopedRoleMembershipId parameter to remove a scoped role membership.

Examples

Example 1: Remove a scoped role membership

Connect-Entra -Scopes 'RoleManagement.Read.Directory'
$role = Get-EntraBetaDirectoryRole -Filter "DisplayName eq 'Helpdesk Administrator'"
$administrativeUnit = Get-EntraBetaAdministrativeUnit -Filter "DisplayName eq 'Pacific Administrative Unit'"
$roleMembership = Get-EntraBetaScopedRoleMembership -AdministrativeUnitId $administrativeUnit.Id | Where-Object {$_.RoleId -eq $role.Id}
Remove-EntraBetaScopedRoleMembership -AdministrativeUnitId $administrativeUnit.Id -ScopedRoleMembershipId $roleMembership.Id

This cmdlet removes a specific scoped role membership from Microsoft Entra ID. You can use the command Get-EntraBetaAdministrativeUnit to get administrative unit Id.

  • -AdministrativeUnitId parameter specifies the ID of an administrative unit.
  • -ScopedRoleMembershipId parameter specifies the ID of the scoped role membership to remove. To obtain the details of a scoped role membership, you can use the Get-EntraBetaScopedRoleMembership command.

Parameters

-AdministrativeUnitId

Specifies the ID of an administrative unit object.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ScopedRoleMembershipId

Specifies the ID of the scoped role membership to remove.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ObjectId

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Related Links


Feedback

Was this page helpful?