๐Ÿ‘ฅ Recipe ยท User & Group Management

List a User's Group Memberships in Entra ID via Microsoft Graph

Audit which security groups, Microsoft 365 groups, and directory roles a user belongs to

Complexity

Beginner

Impact

read-only + audit + access-review + low-risk

Context

Why This Matters

Knowing exactly which groups a user belongs to is foundational for access reviews, offboarding, troubleshooting permission issues, and license audits. In Entra ID (formerly Azure AD), a user's memberOf collection returns both group memberships (security groups, Microsoft 365 groups, distribution lists, dynamic groups) and directory role assignments in a single call.

Run this recipe when you need to:

  • Investigate why a user has (or lacks) access to a resource
  • Document group memberships before offboarding or role changes
  • Identify unexpected privileged role assignments
  • Verify dynamic group rules are assigning users correctly
  • Support compliance or access-review requirements

Expected Outcomes

After completing this recipe you will have:

  • A complete list of groups the target user belongs to, including display names, IDs, and descriptions
  • Visibility into any directory role assignments (e.g., Global Administrator, User Administrator)
  • A repeatable method โ€” GUI, API, or PowerShell โ€” for answering the same question for any user
  • Optionally, an exportable CSV of memberships for reporting or audit evidence

Risks & Considerations

Things to watch for

  • Direct vs transitive membership: /memberOf returns only direct memberships. Use /transitiveMemberOf to include nested group membership.
  • Mixed object types: The response contains both #microsoft.graph.group and #microsoft.graph.directoryRole objects. Filter by @odata.type if you only want groups.
  • Null display names: Directory roles often return null for displayName when using $select. Remove the $select or include it in the projection to get role names.
  • Permissions: Reading another user's memberships requires at minimum GroupMember.Read.All or Directory.Read.All.
  • PII / least privilege: Group memberships can reveal organizational structure. Limit who can run these queries at scale.

Required Permissions

PermissionWhy It's Needed
User.Read.AllRead the target user object to resolve UPN or object ID
GroupMember.Read.AllRead the groups a user is a member of
Directory.Read.AllAlternative broader permission; also returns directory role assignments
RoleManagement.Read.DirectoryRead directory role details when resolving role names

The fastest way to get this done โ€” just ask Dex. Copy the prompt below and paste it into your Dex conversation.

For IT Admins

Paste into Dex CoAdmin

List all group memberships and directory role assignments for {user} in Entra ID. Include both direct and transitive memberships, and flag any privileged roles.
Try in Dex CoAdmin

For End Users

How an employee would ask Dex for help

Which distribution lists and Teams groups am I a member of?
Try in Dex Playground