How to get app roles of a Microsoft Entra ID group using Get-MgGroupAppRoleAssignment

Retrieving app roles of Microsoft Entra ID groups

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.

Get Microsoft Entra ID groups' app roles using Microsoft Graph PowerShell

Prerequisites

Before running the Get-MgGroupAppRoleAssgnment cmdlet, ensure the following requirements are met:

  • The Microsoft Graph PowerShell module is installed. If it’s not installed, use the following command:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with the required permissions to retrieve and manage Microsoft Entra ID groups:
    Connect-MgGraph -Scopes "Group.Read.All"

Using the Get-MgGroupAppRoleAssignment cmdlet to get the app roles of Microsoft Entra ID groups

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 use case and script using the Get-MgGroupAppRoleAssignment cmdlet

Example: Get the app role assignments granted to a group

Get-MgGroupAppRoleAssignment -GroupId "<Your-Group-ID>"

Supported parameters

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.

Challenges of using Graph PowerShell scripts to retrieve Microsoft Entra ID groups' app roles

  • The Microsoft Graph API has throttling limits, which can delay bulk user retrieval and impact efficiency.
  • The absence of a user-friendly graphical interface makes it difficult for those with limited scripting experience.
  • Built-in reporting capabilities are limited, requiring custom scripts for comprehensive insights.
  • Exporting data for reporting often involves additional scripting efforts.

Why use ADManager Plus for management and reporting?

Keep an eye on your Microsoft Entra ID users and groups with ADManager Plus

 
  • Retrieving app roles of Microsoft Entra ID groups
  • Get Microsoft Entra ID groups' app roles using Microsoft Graph PowerShell
  • Challenges of using Graph PowerShell scrips to retrieve Microsoft Entra ID groups' app roles
  • Why use ADManager Plus for management and reporting?
The one-stop solution to Active Directory Management and Reporting
Email Download Link