Get-MsolRoleMember

Gets members of a role.

Syntax

Get-MsolRoleMember [-All] [-RoleObjectId <Guid>] [-SearchString <String>] [-TenantId <Guid>]
 [-MemberObjectTypes <String[]>] [<CommonParameters>]
Get-MsolRoleMember [-MaxResults <Int32>] [-RoleObjectId <Guid>] [-SearchString <String>] [-TenantId <Guid>]
 [-MemberObjectTypes <String[]>] [<CommonParameters>]

Description

The Get-MsolRoleMember cmdlet gets members of the specified role.

Examples

Example 1: Get members of a role

PS C:\> $RoleMembers = Get-MsolRole -RoleName "Company Administrator"
This command returns all the members of the specified role. The command stores the results in the $RoleMembers variable.

Parameters

-All

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

Type:SwitchParameter
Required:True
Position:Named
Default value:None
Accept pipeline input:False

-MaxResults

Specifies the maximum number of results that this cmdlet returns.
The default value is 250.

Type:Int32
Position:Named
Default value:250
Accept pipeline input:False

-RoleObjectId

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

Type:Guid
Position:Named
Default value:None
Accept pipeline input:False

-SearchString

Specifies a string.
This cmdlet returns objects with a display name or email address that start with this string.
The string to search on.

Type:String
Position:Named
Default value:None
Accept pipeline input: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)

-MemberObjectTypes

Specifies an array of member object types.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False

Outputs

Microsoft.Online.Administation.RoleMember

This cmdlet returns role member objects that contain the following information:
* DisplayName. The display name of the role member.
* EmailAddress. The email address of the role member.
* IsLicensed. Whether or not the user is licensed.
* LastDirSyncTime. The date and time that this member was last synced.
* ObjectId. The unique ID of the member.
* OverallProvisioningStatus. The provisioning status of this user.
* RoleMemberType. The type of role member. Currently only "User" is supported.
* ValidationStatus. Whether or not there are any errors with this group member.