--- title: "Identify Administrators with Group Management Permissions in Entra ID" slug: "dex-wf-identify-group-management-admins" updated: 2026-11-30T16:15:31Z published: 2026-11-30T16:15:31Z canonical: "documentation.sysaid.com/dex-wf-identify-group-management-admins" --- > ## Documentation Index > Fetch the complete documentation index at: https://documentation.sysaid.com/llms.txt > Use this file to discover all available pages before exploring further. # Identify Administrators with Group Management Permissions in Entra ID Audit directory role assignments to discover who can create, modify, or manage group memberships in your tenant. **Complexity:** Intermediate. **Impact:** security + compliance + access-review + privileged-access. ## Why use this workflow In Microsoft Entra ID (formerly Azure AD), the ability to manage group memberships is not limited to a single role. Several built-in directory roles carry this privilege: most notably **Global Administrator**, **Privileged Role Administrator**, **User Administrator**, **Groups Administrator**, and **Directory Writers**. Owners of individual groups can also manage membership for their own groups. Regularly auditing who holds these roles is a core part of privileged access hygiene. Group memberships frequently drive access to SharePoint sites, Teams, license assignments, Conditional Access exclusions, and application permissions: so anyone who can modify group membership can effectively escalate access across your tenant. Run this workflow during quarterly access reviews, after organizational changes, before compliance audits (SOC 2, ISO 27001, HIPAA), or whenever you suspect unnecessary privilege sprawl. ## Expected outcomes - A full inventory of users assigned to directory roles that grant group management permissions - Identification of each role holder's assignment type (permanent vs. eligible via PIM) - A CSV/report suitable for access review sign-off - Visibility into service principals and groups that also hold these roles - A baseline to compare against in future audits ## Risks and considerations - **Read-only audit.** This workflow does not modify role assignments. Removing a Global Administrator without a backup break-glass account can lock you out of your tenant. - **PIM eligibility matters.** Standard `/directoryRoles/{id}/members` returns only *active* assignments. Users eligible via Privileged Identity Management are invisible unless you query the PIM endpoints. - **Group-based and nested assignments.** Roles can be assigned to groups; enumerate group members to see the effective admin list. - **Custom roles and admin units.** If your org uses custom roles or administrative-unit-scoped assignments, additional queries are required. - **Group owners also manage membership** for their groups. Don't forget them in your threat model. ## Required permissions | Permission | Why it's needed | | --- | --- | | RoleManagement.Read.Directory | Read directory role definitions and role assignments (including PIM eligibility) | | Directory.Read.All | Resolve principal IDs to user, group, and service principal details | | PrivilegedAccess.Read.AzureAD | Optional: read PIM eligible role assignments | ## Ask Dex Paste the prompt into a Dex conversation. ### Prompt for IT admins ``` List all administrators in our Entra ID tenant who have permissions to manage group memberships. Include holders of Global Administrator, Privileged Role Administrator, User Administrator, Groups Administrator, and Directory Writers roles. Show both active and PIM-eligible assignments, and expand any group-based role assignments into their member users. Export the results as a CSV. ``` ## Manual steps (admin center) 1. Sign in to the **Microsoft Entra admin center** at `https://entra.microsoft.com` as a Global Reader or Privileged Role Administrator. 2. Go to **Identity** > **Roles & admins** > **Roles & admins**. 3. Review each of the following roles in turn. For each, click the role name and review both the **Assignments** tab (active) and **Eligible assignments** tab (PIM): - Global Administrator - Privileged Role Administrator - User Administrator - Groups Administrator - Directory Writers - Teams Administrator (can manage Microsoft 365 group membership) - Exchange Administrator (can manage distribution and M365 groups) - SharePoint Administrator (can manage M365 group membership) 4. For each assignment, record: display name, UPN, principal type (User / Group / Service Principal), assignment type (Active / Eligible), and scope (Directory / Administrative Unit). 5. If a role is assigned to a *group*, click the group and enumerate its members: these members inherit the role. 6. Export each role's member list: on the role page click **Download assignments** to save as CSV. 7. Cross-check against your approved privileged access list. Flag any unexpected holders for removal or review. ### Also review group owners Group owners can manage their group's membership independently of directory roles. Go to **Identity** > **Groups** > **All groups** and review ownership on sensitive groups (admin groups, license-bearing groups, CA exclusion groups). ## Microsoft Graph API ### Step 1: List role definitions that grant group management ``` GET https://graph.microsoft.com/v1.0/roleManagement/directory/roleDefinitions  ?$filter=displayName in (    'Global Administrator',    'Privileged Role Administrator',    'User Administrator',    'Groups Administrator',    'Directory Writers'  )  &$select=id,displayName ``` ### Step 2: Get active role assignments for each role ``` GET https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments  ?$filter=roleDefinitionId eq '{roleDefinitionId}'  &$expand=principal ``` Sample response: ``` {  "value": [    {      "id": "lAPpYvVpN0KR...",      "principalId": "8a7b...",      "roleDefinitionId": "62e90394-...",      "directoryScopeId": "/",      "principal": {        "@odata.type": "#microsoft.graph.user",        "displayName": "Alex Admin",        "userPrincipalName": "alex@contoso.com"      }    }  ] } ``` ### Step 3: Get PIM eligible assignments (optional but recommended) ``` GET https://graph.microsoft.com/v1.0/roleManagement/directory/roleEligibilitySchedules  ?$filter=roleDefinitionId eq '{roleDefinitionId}'  &$expand=principal ``` ### Step 4: Expand group assignments If any `principal` is of type `#microsoft.graph.group`, enumerate its transitive members: ``` GET https://graph.microsoft.com/v1.0/groups/{groupId}/transitiveMembers  ?$select=id,displayName,userPrincipalName ``` ### Required headers ``` Authorization: Bearer {access_token} ConsistencyLevel: eventual   # required for $filter on roleDefinitions ``` ## PowerShell ### Prerequisites - PowerShell 7+ (Windows PowerShell 5.1 also works) - `Microsoft.Graph` module: `Install-Module Microsoft.Graph -Scope CurrentUser` - An account with at minimum the **Global Reader** role ### How it works 1. Connects with the required read-only scopes. 2. Resolves role definition IDs for the target roles by display name. 3. Calls `Get-MgRoleManagementDirectoryRoleAssignment` for active members and `Get-MgRoleManagementDirectoryRoleEligibilitySchedule` for PIM eligibles. 4. Flattens group assignments into their member users. 5. Emits a unified CSV report with columns: `RoleName, PrincipalType, DisplayName, UserPrincipalName, AssignmentType, SourceGroup`. ### Run it ``` .\Get-GroupManagementAdmins.ps1 -OutputPath .\group-admins.csv ``` Open the CSV in Excel, sort by `RoleName`, and review each holder. Pay special attention to service principals and to eligible (PIM) assignments that may be overlooked in the GUI.