Inventory Entra groups
Documentation: Microsoft Learn
Inventory Entra ID groups with Microsoft Graph PowerShell, selecting the group properties needed for a directory report.
The script
Script reader
Inspect before you run
Inspect the script below. It does not run in this browser.
Inspection only — no command has run.
Show reference output
Inspect this example’s structure
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-MgGroup -All -Property DisplayName,SecurityEnabled,MailEnabled,GroupTypes | Select-Object DisplayName,SecurityEnabled,MailEnabled,GroupTypes- Stage 1Get-MgGroup
-All -Property - Stage 2Select-Object
Positional values or no named parameters
How it works
Inventory Entra ID groups with Microsoft Graph PowerShell, selecting the group properties needed for a directory report. SecurityEnabled and MailEnabled together identify the classic group type, and GroupTypes is an array whose contents reveal whether the group is a Microsoft 365 group or uses dynamic membership.
Adapting it
Expand GroupTypes into readable text with a calculated property that joins the array, otherwise a CSV export writes the array's type name in place of its contents.
Requirements
Microsoft.Graph module and a Graph session with Group.Read.All.
If the result is unexpected
The Entra group inventory omits groups or membership details.
A group-list query does not automatically expand all members, and pagination or permissions may constrain results.
- Confirm tenant and paging, then request membership separately for one known group.
Validate the result
The group list is complete for its scope and membership data is clearly identified as a separate query.
Keep the check reliable
Document which group types and membership depth the report covers.