Remove-MsolScopedRoleMember

Removes a user from an administrative unit-scoped role.

Syntax

Remove-MsolScopedRoleMember
      -RoleObjectId <Guid>
      -AdministrativeUnitObjectId <Guid>
      [-RoleMemberObjectId <Guid>]
      [-RoleMemberUserPrincipalName <String>]
      [-TenantId <Guid>]
      [<CommonParameters>]

Description

The Remove-MsolScopedRoleMember cmdlet removes a user from an administrative unit-scoped role.

Examples

Example 1: Remove a member from an administrative unit-scoped role

PS C:\> $WestCoastAu = Get-MsolAdministrativeUnit -SearchString "West Coast"
PS C:\> $UaAdmin = Get-MsolRole -RoleName "User Account Administrator"
PS C:\> $Admin01 = Get-MsolUser -UserPrincipalName "[email protected]"
PS C:\> Remove-MsolScopedRoleMember -RoleObjectId $UaAdmin.ObjectId -AdministrativeUnitObjectId $WestCoastAu.ObjectId -RoleMemberObjectId $Admin01.ObjectId

The example removes [email protected] from the User Account Administrator role scoped for the administrative unit named West Coast. After this example, the user is no longer a member of the role.

Parameters

-AdministrativeUnitObjectId

Specifies the unique object ID of the administrative unit.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RoleMemberObjectId

Specifies the unique object ID of the member to remove from the role scoped to the administrative unit. Specify either the RoleMemberUserPrincipalName or RoleMemberObjectId parameter.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-RoleMemberUserPrincipalName

Specifies the user principal name of the member to remove. Specify either RoleMemberUserPrincipalName or RoleMemberObjectId.

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

-RoleObjectId

Specifies the unique object ID of the role from which to remove members.

Type:Guid
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-TenantId

Specifies the unique ID of the tenant on which to perform the operation. The default value is the tenant of the current user. This parameter applies only to partner users.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False