Get-MsolRoleMember

Updated: July 30, 2015

Applies To: Azure, Office 365, Windows Intune

Note



  • The cmdlets were previously known as the Microsoft Online Services Module for Windows PowerShell cmdlets.

The Get-MsolRoleMember cmdlet is used to retrieve all members of the specified role.

Syntax

Get-MsolRoleMember [-MaxResults <int>] [-RoleObjectId <Guid>] [-SearchString <string>] [-TenantId <Guid>] [<CommonParameters>]

Get-MsolRoleMember [-All] [-RoleObjectId <Guid>] [-SearchString <string>] [-TenantId <Guid>] [<CommonParameters>]

Parameters

    -All [<SwitchParameter>]
        If present then all results will be returned.  Cannot be used with 
        MaxResults parameter.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -MaxResults <int>
        The maximum number of results returned for a search result. If not 
        specified, 250 results will be returned.
        
        Required?                    false
        Position?                    named
        Default value                250
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -RoleObjectId <Guid>
        The ID of the role to retrieve members for.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -SearchString <string>
        The string to search on. Only objects with a display name or email 
        address starting with this string will be returned.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -TenantId <Guid>
        The unique ID of the tenant to perform the operation on. If this is 
        not provided, then the value will default to the tenant of the current 
        user. This parameter is only applicable to partner users.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer and OutVariable. For more information, type,
        "get-help about_commonparameters".

Examples

Output is provided by Microsoft.Online.Administation.RoleMember. For this cmdlet, each RoleMember object will include the following:

  1. DisplayName: The display name of the role member.

  2. EmailAddress: The email address of the role member.

  3. IsLicensed: Whether or not the user is licensed.

  4. LastDirSyncTime: The date and time that this member was last synced.

  5. ObjectId: The unique ID of the member.

  6. OverallProvisioningStatus: The provisioning status of this user.

  7. RoleMemberType; The type of role member. Currently only "User" is supported.

  8. ValidationStatus: Whether or not there are any errors with this group member.

Example 1

The following commands return all the members of the specified role "Company Administrator."

$role = Get-MsolRole -RoleName "Company Administrator"

Get-MsolRoleMember -RoleObjectId $role.ObjectId

Additional Resources

There are several other places you can get more information and help. These include:

See Also

Other Resources

Manage Azure Active Directory by using Windows PowerShell