Get-DSPrincipalRoleAssignment
Synopsis
Get the administrative roles held by a user, user group, or application identity.
Syntax
__AllParameterSets
Get-DSPrincipalRoleAssignment -PrincipalId <guid> [-IncludeIndirect] [<CommonParameters>]Description
Get every administrative role assignment held by the given assignee, across every scope. Reverse lookup of Get-DSRoleAssignment: instead of "who holds a role at this scope", this answers "what roles does this assignee hold, anywhere". Use -IncludeIndirect to also surface roles granted to a user group the assignee belongs to; when an assignment came from a group, GroupID/GroupName identify that group and the assignment is not held directly by the assignee.
Examples
Example 1
PS C:\> Get-DSPrincipalRoleAssignment -PrincipalId $userIDGet every role directly assigned to the user.
Example 2
PS C:\> Get-DSPrincipalRoleAssignment -PrincipalId $userID -IncludeIndirectAlso include roles the user holds through user group membership.
Parameters
-IncludeIndirect
Also include roles granted to a user group the assignee belongs to, not just direct assignments.
-PrincipalId
ID of the user, user group, or application identity to look up.
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.
Outputs
RemoteDesktopManager.PowerShellModule.PSOutputObject.PSPrincipalRoleAssignment
Notes
For more information, type "Get-Help Get-DSPrincipalRoleAssignment -detailed". For technical information, type "Get-Help Get-DSPrincipalRoleAssignment -full".
Last updated
Was this helpful?