Two Ways to Export a List of Microsoft 365 Group Members

Two Ways to Export a List of Microsoft 365 Group Members

It’s easy to find instructions for exporting an Outlook Contact Group to a csv file, but there’s no built in way (as of today, at least) for an end user to export the membership of a Microsoft 365 (Office 365) Group.

Here are two ways it can be done, one for an Exchange Administrator via PowerShell and one for an end user via Microsoft Outlook.

Using PowerShell

If your an Exchange administrator, this method will work for you. This method lets you collect a lot more information about the group members if you modify the “Select” fields in the in the Get-UnifiedGroupLinks cmdlet.

  1. Connect to Exchange Online. You can find instructions for doing that at a million other websites, including Microsoft, so I won’t repeat them here.
  2. Save the group’s email address, name, or GroupID to a variable named “$Group”, like this:
    $Group = “My Office 365 Group”
  3. Copy and paste this code into PowerShell. Change the OutFile path and name to whatever works for you:
$LinkTypes = "Members","Owners"
$Outfile = "C:\Temp\" + $Group + ".csv"
$LinkTypes | Foreach {
    $LinkType = $_
    $Links += (Get-UnifiedGroupLinks -Identity $Group -LinkType $LinkType | Select DisplayName, PrimarySmtpAddress, ExternalEmailAddress, @{n='LinkType';e={$LinkType}})
$Links | Export-Csv $Outfile -NoTypeInformation
Remove-Variable Links

This will create a CSV file with a list of group members and owners like this:

Joe Smithjsmith@domain.comMember
Bob Johnsonbjohnson@domain.comOwner

Using Outlook

This method is best for end users who just need a list of members, but it won’t give you any extra information. This method does not work will in Outlook Online, so I recommend using the desktop client.

  1. Open Outlook desktop client and start a new email message.
  2. Add the group to the To field and click on the plus (+) sign next to the group name to expand the group into the individual members.
  3. Copy and paste the member list into a text file where you can format it however you want.

Your output will look something like this:

Joe Smith <>; <>; Bob Johnson <>

Not ideal, but it gets the job done. I would paste that into Notepad or another raw text editor first, then copy from there into Word in order to remove any formatting. You can use the Find and Replace function in Word to replace the semicolons with line feeds.

Leave a Reply

Your email address will not be published. Required fields are marked *