2 Ways to Export Office 365 Distribution Group Members List to CSV File

An Office 365 distribution group is created by the administrator to broadcast any message or invitation to its assigned members via a single email address. There are scenarios when the administrator has to rebuild the distribution group with its members or need the information of certain members of a single group among the multiple groups. In that case opening each distribution group and getting the information from Exchange Admin Center in the Office 365 account with internet connection would be cumbersome. While having the details of distribution group members in a stored file like CSV which is anytime accessible is a more relaxing way to have the members’ details for any use all the time. In this blog, you will find the different ways to export Office 365 distribution group members to CSV file format.

Manually Exporting Office 365 Distribution Group Members to CSV

For manual solutions, we have two resources to export Office 365 distribution group members to CSV file format. :

  1. PowerShell Scripts – This method includes running of scripts for the export process and thus needs technical expertise in running PowerShell scripts. It means, a novice user would find it difficult to run the scripts in the first go and thus needs some prior training to perform well in order to get the desired results.
  2. Exchange Admin Center Console – This second technique is relatively simple and does not require much skills for the complete process execution. Though users need to be attentive and follow each described steps in a sequential manner. It includes use of the Exchange Admin Center console in-built features which allows export of distribution group members to CSV format,

With this brief introduction of the two manual techniques to export Office 365 distribution group members to CSV, it should be clear in your mind to go for which method from the above two first. But here, without any discrimination, we are explaining procedures included in both the methods one after another.

Expert Solutions

Office 365 Backup to extract your entire mailbox data including emails, contacts, addresses, etc from Office 365 account.

Download Now

Export Office 365 Distribution Group Members to CSV – PowerShell Scripts

The primary requirement is running Windows PowerShell as an administrator and then connecting Exchange Online to PowerShell with the help of following commands.

  1. Run the first command to connect Exchange Online to Windows PowerShell –
    Set-ExecutionPolicy RemoteSigned
  2. Next command to run would be –
    $UserCredential = Get-Credential

    This command would result a pop up asking to enter the Office 365 account login credentials. Provide it and click on OK.

  3. Connect to the session using this command –
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic –AllowRedirection
  4. The final command to run to connect Exchange Online to Windows PowerShell is as follows –
    Import-PSSession $Session –DisableNameChecking

After this last command is run, the Exchange Online is successfully configured within the Windows PowerShell. Now, follow the below commands and scripts for the distribution group export process.

To know the information about the available distribution groups in your Office 365 organization, run this command.

Get-UnifiedGroup -ResultSize Unlimited

This command execution will lists all the Office 365 groups in the organization. You can view which group is required for export from here.

Now, that you know about the groups, you require to know the members of the group before export. Run the following command for this.

Get-UnifiedGroupLinks – Identity <group-name> – LinkType Members – ResultSize Unlimited

You will get the group members list information as a result.

Note: To list all then members from all the Office 365 Distribution Groups for the account, users can run the following script.

Groups = Get-UnifiedGroup -ResultSize Unlimited
$Groups | ForEach-Object {
$group = $_Get-UnifiedGroupLinks -Identity $group.Name -LinkType Members -ResultSize Unlimited | ForEach-Object {
New-Object -TypeName PSObject -Property @{
Group = $group.DisplayName
Member = $_.Name
EmailAddress = $_.PrimarySMTPAddress
RecipientType= $_.RecipientType
}}}

Once decided which distribution group members you want to export to CSV file, run this cmdlet next.

Get-DistributionGroupMember -Identity <Group Name> | Select Name, PrimarySmtpAddress | Export-csv members.csv –NoTypeInformation

It will directly export the distribution group members to the CSV file format with the information details like DisplayName, Group Primary SMTP Address, Member Email, Member’s Type, Group Alias, Group Type, Group Owner(Managed By), Members Count, Members, , etc.

If you want to move members of all Office 365 groups to CSV file format, then use this PowerShell script.

$Groups = Get-UnifiedGroup -ResultSize Unlimited
$Groups | ForEach-Object
{
$group = $_Get-UnifiedGroupLinks -Identity $group.Name -LinkType
Members -ResultSize Unlimited | ForEach-Object
New-Object -TypeName PSObject -Property @
Group = $group.DisplayName
Member = $_.Name
EmailAddress = $_.PrimarySMTPAddress
RecipientType= $_.RecipientType
}}} | Export-CSV “C:\\Office365GroupMembers.csv” -NoTypeInformation -Encoding UTF8

Exchange Admin Center Console for exporting Office 365 distribution group to CSV

  1. Open your Office 365 account with global administrator credentials. Click on Admin option and then click on Exchange option under Admin Centers section from the left pane of Office 365 admin center.
  2. On the Exchange Admin Center page, click on Recipients option and then on Groups.
  3. Now, select the desired distribution group and click on 3 dots (More) option. Now, select Export data to a CSV file option.
    Select the desired distribution group and click on 3 dots (More) option
  4. In the opened Export data window, select the column and click on Export option.
  5. The distribution group members will get exported to CSV file format.

What information will exported CSV file include?

The output CSV file would be displayed in a table form with the information details like Distribution Display Names, Group Names, Group Alias, Members Names, Recipient Type, Primary SMTP Email Address, Members Count, Members Count by Recipient Type, Authorized Senders, and Allows External Recipient.etc. This information is based on the selected number of Distribution Groups Members within Office 365.

Both solutions are executable and need different skills but time consumption is always an issue. Getting Office 365 distribution group members to CSV file is a good attempt to have a record of the members for anytime analyzation and use. For complete Office 365 data backup including emails, contacts, addresses, etc. you can try our automated solution Office 365 backup. It saves or backup the desired Office 365 data to Outlook PST file format easily which you can save as a backup of Office 365 data. The software interface is quite easy to work with and is for all kind of users whether novice or experts. So, take the deal quickly to fulfill your requirements.

Download Now

About Elias Macclure

Elias has a sleek writing style, and the reader may find that the extensive nuances of the material are covered in the article. He changes the writing style according to the platform and writes fine for Office 365 and SharePoint. He is an active reader and reads books by renowned writers including Charles Dickens, Sidney Sheldon and Agatha Christie.

Leave a Reply

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

9  +  1  =