Support
 
Phone Live Chat
 
Support
 
US: +1 888 720 9500
 
Intl: +1 925 924 9500
Aus: +1 800 631 268
UK: 0800 028 6590
CN: +86 400 660 8680

Direct Inward Dialing: +1 408 916 9393

 
 
 
 
 

How to get Microsoft 365 group members

This guide covers how to generate the membership list of Microsoft 365 groups using the Microsoft 365 admin center, PowerShell, or ManageEngine ADManager Plus. It also explores scheduling and exporting the membership lists.

 
  • Microsoft 365 admin center
  • PowerShell
  • ADManager Plus
  • Why ADManager Plus
  • Real-world use cases
  • FAQ
  • Troubleshooting
 

How to get Microsoft 365 group membership using the Microsoft 365 admin center

Prerequisites

  • Permissions: Sign in with the Global Reader role for view-only access, or with the Groups Administrator or Exchange Administrator role. Microsoft recommends the role with the fewest permissions, so use Global Administrator only when no other role fits.
  • Tools: A web browser and access to the Microsoft 365 admin center at admin.cloud.microsoft.

Steps to get Microsoft 365 group membership using the Microsoft 365 admin center

  1. Sign in to the Microsoft 365 admin center at admin.cloud.microsoft.
  2. In the left navigation, expand Teams & groups and select Active teams & groups. If you don't see it, select Show all first.
  3. Select the name of the Microsoft 365 group to open its details pane.
  4. On the Membership tab, select Members to list the members. Select Owners to list the owners.
  5. Select Close, then repeat the steps for the next group.
Note:

These tab names apply to Microsoft 365 groups. Distribution lists and security groups open with a Members tab and a View all and manage members link instead.

Limitations for getting Microsoft 365 group membership via the Microsoft 365 admin center

  • The details pane shows one group at a time, so reviewing many groups means repeating the steps for each one.
  • The steps are manual, so every membership review repeats the same clicks.

Steps to get Microsoft 365 group membership using PowerShell

Prerequisites

  • Permissions for Exchange Online: Use an account that has the View-Only Recipients role. Exchange Online assigns it through the Global Reader and Exchange Administrator roles.
  • Permissions for Microsoft Graph: Consent to the GroupMember.Read.All and User.Read.All scopes, which need administrator consent the first time they are used. The signed-in account also needs a Microsoft Entra role that can read group members, such as Groups Administrator, Directory Readers, or Exchange Administrator.
  • Tools: The Exchange Online PowerShell module (ExchangeOnlineManagement) for the first method and the Microsoft Graph PowerShell SDK for the second. On Windows, the Exchange Online module also needs the PowerShellGet and PackageManagement modules. In PowerShell 7, version 3.10.0 or later of the module needs PowerShell 7.6 or later. Windows PowerShell 5.1 works with every version.
  • Setup: Run Set-ExecutionPolicy RemoteSigned in an elevated PowerShell session so scripts can load.

To install both modules, run:

Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser
Install-Module Microsoft.Graph -Scope CurrentUser

Exchange Online PowerShell reads membership with Get-UnifiedGroupLinks, and Microsoft Graph PowerShell reads it with Get-MgGroupMember. Both return the direct members of a Microsoft 365 group.

Method 1: Exchange Online PowerShell

  1. Connect to Exchange Online:
    Connect-ExchangeOnline -UserPrincipalName admin@zylker.com
  2. List the Microsoft 365 groups with Get-UnifiedGroup and note the email address of the group you need. Email addresses are unique, but display names are not.
    Get-UnifiedGroup -ResultSize Unlimited | Select-Object DisplayName, Alias, PrimarySmtpAddress
  3. Pass the group's identity (its name, alias, email address, or GUID) to Get-UnifiedGroupLinks with -LinkType Members. Add -ResultSize Unlimited, because the default is 1000 results.
    Get-UnifiedGroupLinks -Identity "marketing@zylker.com" -LinkType Members -ResultSize Unlimited | Select-Object DisplayName, PrimarySmtpAddress
  4. Pipe the result to Export-Csv to save the member list:
    Get-UnifiedGroupLinks -Identity "marketing@zylker.com" -LinkType Members -ResultSize Unlimited | Select-Object DisplayName, PrimarySmtpAddress | Export-Csv -Path "C:\Reports\Marketing-members.csv" -NoTypeInformation
  5. Disconnect the session:
    Disconnect-ExchangeOnline -Confirm:$false

Method 2: Microsoft Graph PowerShell

  1. Connect with Connect-MgGraph using the scopes that read groups, members, and users. Without User.Read.All, each member comes back with only an ID and a type.
    Connect-MgGraph -Scopes "GroupMember.Read.All","User.Read.All"
  2. Find the group's ID with Get-MgGroup. This ID is the Group ID that Get-MgGroupMember expects.
    Get-MgGroup -Filter "DisplayName eq 'Marketing'" | Select-Object Id, DisplayName
  3. Pass the Group ID to Get-MgGroupMember with -All, because Graph returns 100 members per page by default. Graph returns each member as a directory object, so the display name and email address sit in AdditionalProperties.
    Get-MgGroupMember -GroupId "<group-id>" -All | Select-Object Id, @{Name="DisplayName";Expression={$_.AdditionalProperties["displayName"]}}, @{Name="Mail";Expression={$_.AdditionalProperties["mail"]}}
  4. Pipe the result to Export-Csv to save the member list:
    Get-MgGroupMember -GroupId "<group-id>" -All | Select-Object Id, @{Name="DisplayName";Expression={$_.AdditionalProperties["displayName"]}}, @{Name="Mail";Expression={$_.AdditionalProperties["mail"]}} | Export-Csv -Path "C:\Reports\Marketing-members-graph.csv" -NoTypeInformation
  5. Disconnect the session:
    Disconnect-MgGraph

Supported parameters: Get-UnifiedGroup

The following parameters are used when listing Microsoft 365 groups in Exchange Online.

Parameter Description
-Identity The group to return. Accepts the name, alias, distinguished name, canonical DN, email address, or GUID.
-Filter Returns only the groups that match an OPATH filter, such as ResourceProvisioningOptions -eq "Team".
-ResultSize The maximum number of groups to return. The default is 1,000. Use Unlimited to return all.
-SortBy Sorts the results by Name, DisplayName, or Alias.
-IncludeSoftDeletedGroups Includes deleted groups that can still be recovered.

Supported parameters: Get-UnifiedGroupLinks

The following parameters are used when reading the members of a Microsoft 365 group.

Parameter Description
-Identity The group to read. Accepts the same values as Get-UnifiedGroup and takes pipeline input from it.
-LinkType Required. Members, Owners, or Subscribers.
-ResultSize The maximum number of results to return. The default is 1,000. Use Unlimited to return all.

Supported parameters: Get-MgGroup

The following parameters are used when finding the Group ID in Microsoft Graph PowerShell.

Parameter Description
-Filter Returns the groups that match a filter, such as "DisplayName eq 'Marketing'".
-GroupId The Group ID of a single group to return.
-All Returns all pages of results.
-Property Selects the properties to return.

Supported parameters: Get-MgGroupMember

The following parameters are used when listing group members in Microsoft Graph PowerShell.

Parameter Description
-GroupId Required. The Group ID of the group whose members you want.
-All Returns all pages of results. Graph returns 100 members per page by default.
-Filter Filters the members by property values. Needs -ConsistencyLevel eventual and -CountVariable.
-PageSize Sets the page size of the results.
-Property Selects the properties to return.

Limitations for getting Microsoft 365 group membership via PowerShell

  • Get-UnifiedGroup and Get-UnifiedGroupLinks run only in Exchange Online and read only Microsoft 365 groups, so distribution lists and security groups need other cmdlets.
  • Both Exchange cmdlets return 1,000 results unless you add -ResultSize Unlimited, which makes a truncated list easy to miss.
  • Exchange Online cmdlets that use the REST API time out after 15 minutes, which can cut off a loop across many groups.
  • Get-MgGroupMember returns direct members only, and it returns IDs without names unless User.Read.All is granted.
  • Adding a column or changing the export format means editing the script and running it again, and troubleshooting errors is manual.

How to get Microsoft 365 group membership using ADManager Plus

Prerequisites

  • Permissions: A help desk technician role that includes access to Microsoft 365 reports. The Microsoft 365 tenant must also be delegated to the technician, even when the technician holds the super admin role.
  • Tools: ADManager Plus with a Microsoft 365 tenant configured in it.

Steps to get Microsoft 365 group membership using ADManager Plus

  1. Log in to ADManager Plus and click the Microsoft 365 tab.
  2. Click Reports in the left pane, then click Group Reports.
  3. Under General Group Reports, click Group Members.
  4. Select the Microsoft 365 tenant from the drop-down list.
  5. Select the groups to report on. Use the Filter By drop-down to narrow the list by domain or group.
  6. Click Generate.
  7. Export the report as CSV, PDF, HTML, or XLSX.
ADManager Plus Group Members report listing the members of the selected Microsoft 365 groups
Group Members report in ADManager Plus, listing the members of the selected Microsoft 365 groups.

How ADManager Plus streamlines Microsoft 365 group membership reporting

ADManager Plus is a tool for managing and reporting on AD, Microsoft 365, and Exchange, and group membership reports are one of its Microsoft 365 reports.

Real-world use cases

Use case 1: Export members of all Microsoft 365 groups to a single CSV file

This script loops through every Microsoft 365 group, reads its members with Get-UnifiedGroupLinks, and writes one row per member to a single CSV file.

Connect-ExchangeOnline -UserPrincipalName admin@zylker.com
Get-UnifiedGroup -ResultSize Unlimited | ForEach-Object {
    $group = $_
    Get-UnifiedGroupLinks -Identity $group.Name -LinkType Members -ResultSize Unlimited | ForEach-Object {
        [PSCustomObject]@{
            Group = $group.DisplayName
            Member = $_.DisplayName
            EmailAddress = $_.PrimarySmtpAddress
            RecipientType = $_.RecipientType
        }
    }
} | Export-Csv -Path "C:\Reports\All-M365-group-members.csv" -NoTypeInformation -Encoding UTF8
Disconnect-ExchangeOnline -Confirm:$false
VS Code showing the PowerShell script and the CSV listing each Microsoft 365 group with its members in the terminal
The script and its sample output: the CSV of all group members, shown with Import-Csv and Format-Table.

To get the same list without a script, use the Group Members report in ADManager Plus:

  1. Go to Microsoft 365 > Reports > Group Reports, and click Group Members under General Group Reports.
  2. Select the Microsoft 365 tenant from the drop-down list.
  3. Select the groups to include in the report.
  4. Click Generate.
  5. Export the report as CSV. To repeat the export on a fixed interval, schedule the report.

FAQs

Filter the member list for the user's email address. If the command returns nothing, the user is not a direct member. Use the address the member has in Exchange Online, which can differ from the sign-in name.

Get-UnifiedGroupLinks -Identity "marketing@zylker.com" -LinkType Members -ResultSize Unlimited | Where-Object { $_.PrimarySmtpAddress -eq "jsmith@zylker.com" }

In Microsoft Graph PowerShell, check whether the user's object ID appears in the Get-MgGroupMember results. In ADManager Plus, generate the Group Members report for the group and look for the user.

Get-UnifiedGroupLinks reads Microsoft 365 groups. Get-DistributionGroupMember reads distribution groups and mail-enabled security groups, so it does not return the members of a Microsoft 365 group. For distribution groups, see how to export distribution group members using PowerShell.

Run Get-UnifiedGroupLinks with -LinkType Owners instead of -LinkType Members. In Microsoft Graph PowerShell, Get-MgGroupOwner returns the owners, as explained in this guide to getting Entra ID group owners.

Graph returns each member as a directory object, so the display name and email address sit in AdditionalProperties instead of in columns. If those values are empty too, the session cannot read users. Reconnect with User.Read.All in the scopes. For the parameters of the cmdlet, see how to get Entra ID group members with Get-MgGroupMember.

No. You cannot add a distribution list or another Microsoft 365 group as a member of a Microsoft 365 group, so there is no nested group to expand when you list the members.

Yes. Microsoft Teams uses a Microsoft 365 group for its membership, so the same commands list a team's members. To list only the groups that back a team, run:

Get-UnifiedGroup -Filter {ResourceProvisioningOptions -eq "Team"}

Troubleshooting

The execution policy is blocking the module scripts. Run Set-ExecutionPolicy RemoteSigned in an elevated PowerShell session, then connect again.

The ExchangeOnlineManagement module is not installed or not loaded. Run Install-Module -Name ExchangeOnlineManagement, then Import-Module ExchangeOnlineManagement, and connect again.

Connections to Exchange Online on Windows need the PowerShellGet module, which in turn needs PackageManagement. Install or update both, close and reopen PowerShell, and connect again.

The account may lack an Exchange Online role that includes these cmdlets, such as View-Only Recipients, or the connection may not have completed. Check the role assignment, then disconnect and connect again.

Get-UnifiedGroup and Get-UnifiedGroupLinks return 1,000 results by default. Add -ResultSize Unlimited to both commands.

The -Identity value was $null or does not match any group, and Exchange Online then returns all groups. This often happens inside a loop. Check that the value exists before you pass it.

Graph returns 100 members per page by default. Add -All to return every page.

Exchange Online cmdlets that use the REST API time out after 15 minutes. Run the loop for fewer groups at a time, for example by narrowing Get-UnifiedGroup with -Filter.

ADManager Plus Trusted By

The one-stop solution to Active Directory Management and Reporting