Get-​Msol​Scoped​Role​Member

Gets members of a role who are granted that role over an administrative unit.

Syntax

Get-MsolScopedRoleMember
   [-RoleObjectId <Guid>]
   [-AdministrativeUnitObjectId <Guid>]
   [-MaxResults <Int32>]
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolScopedRoleMember
   [-RoleObjectId <Guid>]
   [-AdministrativeUnitObjectId <Guid>]
   [-TenantId <Guid>]
   [-All]
   [<CommonParameters>]

Description

The Get-MsolScopedRoleMember cmdlet gets members of the specified role who are granted that role over an administrative unit.

Examples

Example 1: Get members of the User Account Administrator role

PS C:\> $WestCoastAu = Get-MsolAdministrativeUnit -SearchString "West Coast"
PS C:\> $UaAdmin = Get-MsolRole -RoleName "User Account Administrator"
PS C:\> Get-MsolScopedRoleMember -RoleObjectId $UaAdmin.ObjectId -AdministrativeUnitObjectId $WestCoastAu.ObjectId

This example gets all members of the User Account Administrator role that is scoped to the administrative unit named West Coast.

Required Parameters

-All

Indicates that this cmdlet returns all results that it finds. Do not specify this parameter and the MaxResults parameter.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-AdministrativeUnitObjectId

Specifies the unique object ID of the administrative unit. If you do not specify this parameter, this cmdlet gets administrators for all administrative units.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaxResults

Specifies the maximum number of results that this cmdlet returns.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RoleObjectId

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

Type:Guid
Position:Named
Default value:None
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
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Outputs

Microsoft.Online.Administration.RoleScopedMember

This cmdlet returns objects that contain the following information:

  • DisplayName. The display name of the scoped role member.
  • UserPrincipalName. The user principal name of the scoped role member.
  • ObjectId. The unique ID of the scoped role member.