Get-AzureADMSRoleAssignment

In this Azure article, we will discuss the syntax and usage of the Get-AzureADMSRoleAssignment PowerShell command with examples of how to use this command.

Get-AzureADMSRoleAssignment

This PowerShell command can help you to retrieve the information about the role assignments in your Azure AD.

Syntax

Below is the syntax of the Get-AzureADMSRoleAssignment PowerShell command.

Get-AzureADMSRoleAssignment
Get-AzureADMSRoleAssignment -Id <String>
Get-AzureADMSRoleAssignment
 [-SearchString <String>]

Let’s discuss an example of how to use the Get-AzureADMSRoleAssignment PowerShell command.

Example-1:

You can execute the below Azure PowerShell command to get the information about the role assignments in your Azure AD.

Get-AzureADMSRoleAssignment

After executing this command, I got the expected output as below.

PS C:\WINDOWS\system32> Get-AzureADMSRoleAssignment

RoleDefinitionId                     PrincipalId                          Id          
----------------                     -----------                          --          
62e90394-69f5-4237-9190-012177145e10 54481342-e592-47c2-ba89-b07dcadf9346 lAPpYvVpN...
88d8e3e3-8f55-4a1e-953a-9b9898b8876b bca59d33-14f6-414e-ab7b-eda0faa9584e 4-PYiFWPH...

You can see the same output below

Get-AzureADMSRoleAssignment

Example-2:

You can also use the below PowerShell cmdlet to get details information about the Roleasignments based on the specified Principal Id with a filter condition.

Get-AzureADMSRoleAssignment -Filter "principalId eq '54481342-e592-47c2-ba89-b07dcadf9346'"

After executing this, I got the output as expected. You can see the below screenshot for your reference.

Get-AzureADMSRoleAssignment PowerShell

Check out a video tutorial on the Get-AzureADMSRoleAssignment PowerShell command.

Final Thoughts

In this Azure PowerShell article, we discussed the syntax and usage of the Get-AzureADMSRoleAssignment PowerShell command with examples of how to use this command. Thanks for reading this article !!!