Edit

Share via


Get-RdsRoleAssignment

Lists role assignments at a defined scope.

Syntax

EmptyParameterSet (Default)

Get-RdsRoleAssignment
    [-SignInName <String>]
    [-TenantGroupName <String>]
    [-TenantName <String>]
    [-HostPoolName <String>]
    [-AppGroupName <String>]
    [<CommonParameters>]

SignInNameParameterSet

Get-RdsRoleAssignment
    [-SignInName <String>]
    [-TenantGroupName <String>]
    [-TenantName <String>]
    [-HostPoolName <String>]
    [-AppGroupName <String>]
    [<CommonParameters>]

ServicePrincipalParameterSet

Get-RdsRoleAssignment
    [-ServicePrincipalName <String>]
    [-TenantGroupName <String>]
    [-TenantName <String>]
    [-HostPoolName <String>]
    [-AppGroupName <String>]
    [<CommonParameters>]

GroupObjectIdParameterSet

Get-RdsRoleAssignment
    [-GroupObjectId <String>]
    [-TenantGroupName <String>]
    [-TenantName <String>]
    [-HostPoolName <String>]
    [-AppGroupName <String>]
    [<CommonParameters>]

Description

The Get-RdsRoleAssignment cmdlet lists all role assignments at the defined scope. Without any parameters, this command returns all the role assignments starting at the highest scope authorized to the current user. To define the scope, you can use a combination of the following parameters:

  • TenantGroupName
  • TenantName
  • HostPoolName
  • AppGroupName

This list can be also be filtered by specifying the principal of the role assignment. To specify the principal, you can use one of the following parameters:

  • SignInName
  • ServicePrincipalName
  • GroupObjectId

Examples

Example 1: List all role assignments

PS C:\> Get-RdsRoleAssignment

RoleAssignmentId   : cccc-cccc-cccc-cccc-cccc
Scope              : /Default Tenant Group/contoso/contosoHostPool/Desktop Application Group
TenantGroupName    : Default Tenant Group
TenantName         : contoso
HostPoolName       : contosoHostPool
AppGroupName       : Desktop Application Group
DisplayName        : admin
SignInName         : admin@contoso.com
GroupObjectId      : aaaa-aaaa-aaaa-aaaa-aaaa
AADTenantId        : xxxx-xxxx-xxxx-xxxx-xxxx
AppId              : yyyy-yyyy-yyyy-yyyy-yyyy
RoleDefinitionName : RDS Owner
RoleDefinitionId   : 3b14baea-8d82-4610-f5da-08d623dd1cc4
ObjectId           : bbbb-bbbb-bbbb-bbbb-bbbb
ObjectType         : User
Item               :

RoleAssignmentId   : cccc-cccc-cccc-cccc-cccc
Scope              : /Default Tenant Group/contoso
TenantGroupName    : Default Tenant Group
TenantName         : contoso
HostPoolName       :
AppGroupName       :
DisplayName        :
SignInName         :
GroupObjectId      : 0000-0000-0000-0000-0000
AADTenantId        : 0000-0000-0000-0000-0000
AppId              : yyyy-yyyy-yyyy-yyyy-yyyy
RoleDefinitionName : RDS Reader
RoleDefinitionId   : 3b14baea-8d82-4610-f5da-08d623dd1cc4
ObjectId           : bbbb-bbbb-bbbb-bbbb-bbbb
ObjectType         : ServicePrincipal
Item               :

This command gets all role assignments in the current context, starting at the highest scope authorized for the current user.

Example 2: List role assignments for a user

PS C:\> Get-RdsRoleAssignment -SignInName "admin@contoso.com"

RoleAssignmentId   : cccc-cccc-cccc-cccc-cccc
Scope              : /contosoTenantGroup/contosoA/contosoAHostPool/Desktop Application Group
TenantGroupName    : contosoTenantGroup
TenantName         : contosoA
HostPoolName       : contosoAHostPool
AppGroupName       : Desktop Application Group
DisplayName        : admin
SignInName         : admin@contoso.com
GroupObjectId      : aaaa-aaaa-aaaa-aaaa-aaaa
AADTenantId        : 0000-0000-0000-0000-0000
AppId              : yyyy-yyyy-yyyy-yyyy-yyyy
RoleDefinitionName : RDS Owner
RoleDefinitionId   : 3b14baea-8d82-4610-f5da-08d623dd1cc4
ObjectId           : bbbb-bbbb-bbbb-bbbb-bbbb
ObjectType         : User
Item               :

RoleAssignmentId   : cccc-cccc-cccc-cccc-cccc
Scope              : /contosoTenantGroup/contosoB/contosoBHostPool/Desktop Application Group
TenantGroupName    : contosoTenantGroup
TenantName         : contosoB
HostPoolName       : contosoBHostPool
AppGroupName       : Desktop Application Group
DisplayName        : admin
SignInName         : admin@contoso.com
GroupObjectId      : aaaa-aaaa-aaaa-aaaa-aaaa
AADTenantId        : 0000-0000-0000-0000-0000
AppId              : yyyy-yyyy-yyyy-yyyy-yyyy
RoleDefinitionName : RDS Reader
RoleDefinitionId   : 2ea11dc0-46e3-4ee8-f5db-08d623dd1cc4
ObjectId           : bbbb-bbbb-bbbb-bbbb-bbbb
ObjectType         : User
Item               :

This command gets all role assignments for the specified user in the current context.

Example 3: List role assignments for a service principal

PS C:\> Get-RdsRoleAssignment -ServicePrincipalName "yyyy-yyyy-yyyy-yyyy-yyyy"

RoleAssignmentId   : cccc-cccc-cccc-cccc-cccc
Scope              : /contosoTenantGroup/contosoA/contosoAHostPool
TenantGroupName    : contosoTenantGroup
TenantName         : contosoA
HostPoolName       : contosoAHostPool
AppGroupName       :
DisplayName        :
SignInName         :
GroupObjectId      : 0000-0000-0000-0000-0000
AADTenantId        : 0000-0000-0000-0000-0000
AppId              : yyyy-yyyy-yyyy-yyyy-yyyy
RoleDefinitionName : RDS Reader
RoleDefinitionId   : 2ea11dc0-46e3-4ee8-f5db-08d623dd1cc4
ObjectId           : bbbb-bbbb-bbbb-bbbb-bbbb
ObjectType         : ServicePrincipal
Item               :

RoleAssignmentId   : cccc-cccc-cccc-cccc-cccc
Scope              : /contosoTenantGroup/contosoB/contosoBHostPool/Desktop Application Group
TenantGroupName    : contosoTenantGroup
TenantName         : contosoB
HostPoolName       : contosoBHostPool
AppGroupName       : Desktop Application Group
DisplayName        :
SignInName         :
GroupObjectId      : 0000-0000-0000-0000-0000
AADTenantId        : 0000-0000-0000-0000-0000
AppId              : yyyy-yyyy-yyyy-yyyy-yyyy
RoleDefinitionName : RDS Owner
RoleDefinitionId   : 3b14baea-8d82-4610-f5da-08d623dd1cc4
ObjectId           : bbbb-bbbb-bbbb-bbbb-bbbb
ObjectType         : ServicePrincipal
Item               :

This command gets all role assignments for the specified service principal in the current context. You must provide the application ID of the service principal as the value of the parameter.

Example 4: List role assignments for an Azure AD group

PS C:\> Get-RdsRoleAssignment -GroupObjectId "aaaa-aaaa-aaaa-aaaa-aaaa"

RoleAssignmentId   : cccc-cccc-cccc-cccc-cccc
Scope              : /contosoTenantGroup/contosoA
TenantGroupName    : contosoTenantGroup
TenantName         : contosoA
HostPoolName       :
AppGroupName       :
DisplayName        :
SignInName         :
GroupObjectId      : aaaa-aaaa-aaaa-aaaa-aaaa
AADTenantId        : dddd-dddd-dddd-dddd-dddd
AppId              :
RoleDefinitionName : RDS Operator
RoleDefinitionId   : 827a079d-aa89-4d0d-f5dd-08d623dd1cc4
ObjectId           : bbbb-bbbb-bbbb-bbbb-bbbb
ObjectType         : Group
Item               :

RoleAssignmentId   : cccc-cccc-cccc-cccc-cccc
Scope              : /contosoTenantGroup/contosoB/contosoBHostPool/Desktop Application Group
TenantGroupName    : contosoTenantGroup
TenantName         : contosoB
HostPoolName       : ontosoBHostPool
AppGroupName       : Desktop Application Group
DisplayName        :
SignInName         :
GroupObjectId      : aaaa-aaaa-aaaa-aaaa-aaaa
AADTenantId        : dddd-dddd-dddd-dddd-dddd
AppId              :
RoleDefinitionName : RDS Owner
RoleDefinitionId   : 3b14baea-8d82-4610-f5da-08d623dd1cc4
ObjectId           : bbbb-bbbb-bbbb-bbbb-bbbb
ObjectType         : Group
Item               :

This command gets all role assignments for the specified Azure AD group in the current context.

Parameters

-AppGroupName

The name of the app group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Deployment

A scope specific to Windows Virtual Desktop.

Parameter properties

Type:Switch
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-GroupObjectId

The object ID of the Azure AD group to filter for role assignments.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:UserGroupObjectId

Parameter sets

GroupObjectIdParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-HostPoolName

The name of the host pool.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ServicePrincipalName

The application ID of the service principal to filter for role assignments.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SPN, ApplicationId

Parameter sets

ServicePrincipalParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SignInName

The user principal name (UPN) of the user to filter for role assignments.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Email, UserPrincipalName

Parameter sets

EmptyParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
SignInNameParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TenantGroupName

The name of the tenant group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-TenantName

The name of the tenant.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.String

Outputs

System.Object