How to Generate a Report of Microsoft 365 Group Members
Question details
The user needs to extract a list of members from Microsoft 365 groups, including bulk exports of hundreds of groups to a single report instead of running manual queries for each.

- Product
- Microsoft 365
- Device & OS
- not provided
- Scenario
- An IT administrator needs to audit group memberships or generate a bulk CSV report covering all distribution lists, security groups, and Microsoft 365 groups.
- Observed behavior
- Manual exporting is inefficient for multiple groups, prompting the need for a bulk extraction method using PowerShell or admin tools to output group names, member names, and emails.
Ensure you have Global Administrator or Exchange Administrator privileges in Microsoft 365, and verify that the Microsoft Graph PowerShell module is installed on your computer.
Use Microsoft Graph PowerShell to Export All Group Members to CSV
The most efficient way to generate a bulk report for hundreds of Microsoft 365 groups is by using a Microsoft Graph PowerShell script that iterates through all groups and exports the data to a CSV file.
Microsoft Graph PowerShell replaces older modules like MSOnline and AzureAD. By scripting the extraction process, you can easily pull the group name, member name, email address, and membership type into a single, organized CSV file for auditing.
Search for Windows PowerShell in your Start menu, right-click on it, and select 'Run as administrator'.
If you haven't already, run 'Install-Module Microsoft.Graph -Scope CurrentUser'. Then, connect to your tenant by running 'Connect-MgGraph -Scopes "Group.Read.All", "GroupMember.Read.All"' and signing in with your admin credentials.
Use a script utilizing 'Get-MgGroup -All' to fetch all groups, and then a 'foreach' loop to process each group. Inside the loop, use 'Get-MgGroupMember -GroupId $group.Id -All' to retrieve the members of that specific group.
Format the retrieved variables into custom PSObjects and pipe the final array of results into the 'Export-Csv -Path "C:\GroupReport.csv" -NoTypeInformation' cmdlet to generate your bulk report.

Export Members of a Single Group via Microsoft 365 Admin Center
If you only need a report for one or two specific groups, you can quickly export the member list directly from the web-based Microsoft 365 Admin Center without writing any code.
Open and Analyze Your CSV Reports with WPS Office
After exporting your Microsoft 365 group members to a CSV file, you need a reliable spreadsheet tool to view, filter, and analyze the data. WPS Office is a powerful, free, and lightweight alternative to Microsoft Office that perfectly handles CSV and Excel files, making it easy to manage your administrative reports.
- 1. Install WPS Office: Download WPS Office for free from the official website and complete the quick installation process.
- 2. Open Your Report: Launch WPS Spreadsheets, click 'Open', and select the CSV file generated by your PowerShell script or the M365 Admin Center.
- 3. Format and Analyze: Use WPS Spreadsheets' sorting, filtering, and conditional formatting features to easily identify specific group members or anomalies in your report.

Frequently Asked Questions
Can I export nested group members in Microsoft 365?
Yes, but it requires a more advanced PowerShell script. Standard cmdlets like 'Get-MgGroupMember' only pull direct members. To list nested members, your script must check if a member is a group itself and then recursively query that nested group's members.
Why is my PowerShell script returning limited results for large groups?
Microsoft Graph API implements pagination for performance reasons. If a group has many members, you must ensure your PowerShell command includes the '-All' parameter (e.g., Get-MgGroupMember -All) so it pages through and retrieves the complete member list.
Can I export members of a Dynamic Distribution Group using this method?
No, Microsoft Graph PowerShell group commands do not retrieve members of Dynamic Distribution Groups because their membership is calculated based on rules at the time of email delivery. You must use Exchange Online PowerShell cmdlets, such as 'Get-DynamicDistributionGroup' and 'Get-Recipient', to evaluate and export those members.
What permissions are required to run the Microsoft Graph PowerShell script?
To read all groups and their memberships across your tenant, you need to connect to Microsoft Graph with the 'Group.Read.All' and 'GroupMember.Read.All' scopes. An account with Global Administrator, Groups Administrator, or Global Reader roles will have sufficient access to consent to these scopes.




