Application role assignments in Microsoft Entra ID help define the permissions granted to applications for accessing group resources. IT administrators often need to retrieve these assignments to monitor and manage app permissions effectively. PowerShell cmdlets like Get-MgGroupAppRoleAssignment in Microsoft Graph allow fetching app role assignments for groups, though they require extensive scripting and manual effort.
Before running the Get-MgGroupAppRoleAssgnment cmdlet, ensure the following requirements are met:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Group.Read.All"
Use the Get-MgGroupAppRoleAssignment cmdlet in Microsoft Graph PowerShell to retrieve the app roles granted to Microsoft Entra ID groups. The syntax is as follows:
Get-MgGroupAppRoleAssignment
-GroupId <String>
[-ExpandProperty <String[]>]
[-Property <String[]>]
[-Filter <String>]
[-Search <String>]
[-Skip <Int32>]
[-Sort <String[]>]
[-Top <Int32>]
[-ConsistencyLevel <String>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PageSize <Int32>]
[-All]
[-CountVariable <String>]
[-ProgressAction <ActionPreference>]
[<CommonParameters>]
Example: Get the app role assignments granted to a group
Get-MgGroupAppRoleAssignment -GroupId "<Your-Group-ID>"
The table below lists key parameters that can be used with the Get-MgGroupAppRoleAssignment cmdlet to efficiently retrieve the app roles granted to Microsoft Entra ID groups.
| Parameters | Description |
|---|---|
| -All | This lists all pages. |
| -AppRoleAssignmentId | This is a unique identifier of the AppRoleAssignment object. |
| -ConsistencyLevel | This indicates the requested consistency level. |
| -CountVariable | This specifies the count of the total number of items in a collection. |
| -Filter | This filters the items by property values. |
Note: Microsoft has announced the deprecation of Azure AD PowerShell and its transition to Microsoft Graph PowerShell.