Edit

Share via


Get-AzureADUserAppRoleAssignment

Get a user application role assignment.

Syntax

Default (Default)

Get-AzureADUserAppRoleAssignment
    -ObjectId <String>
    [-All <Boolean>]
    [-Top <Int32>]
    [<CommonParameters>]

Examples

Example 1: Get a user application role assignment

PS C:\> $UserId = (Get-AzureADUser -Top 1).ObjectId
Get-AzureADUserAppRoleAssignment -ObjectId $UserId

The first command gets the ID of an Azure AD user by using the Get-AzureADUser (./Get-AzureADUser.md)cmdlet. The command stores the value in the $UserId variable.

The second command gets a user application role assignment for the user in $UserId.

Parameters

-All

If true, return all user application role assignments for this user. If false, return the number of objects specified by the Top parameter

Parameter properties

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

Parameter sets

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

-ObjectId

Specifies the ID of a user (as a UPN or ObjectId) in Azure Active Directory.

Parameter properties

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

Parameter sets

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

-Top

Specifies the maximum number of records to return.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
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.

Notes

See the migration guide for Get-AzureADUserAppRoleAssignment to the Microsoft Graph PowerShell.