Rediger

Del via


Get-MsolRole

Gets administrator roles.

Syntax

Get-MsolRole
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolRole
   -ObjectId <Guid>
   [-TenantId <Guid>]
   [<CommonParameters>]
Get-MsolRole
   -RoleName <String>
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Get-MsolRole cmdlet gets a list of administrator roles.

Examples

Example 1: Get administrator roles for the company

PS C:\> Get-MsolRole

This command gets administrator roles for the company.

Parameters

-ObjectId

Specifies the unique object ID of the role to retrieve.

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

-RoleName

Specifies the name of the role to retrieve.

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

Outputs

Microsoft.Online.Administration.Role

This cmdlet returns role objects that contain the following fields:

  • Description. A description of the role.

  • IsEnabled. Whether or not the role is enabled.

  • IsSystem. Whether or not the role was created by Azure Active Directory.

  • Name. The name of the role.

  • ObjectId. The unique ID of the role.