2 Methods to Export Office 365 Distribution Group Members List to CSV

Last updated on June 9th, 2022 at 04:56 am

A Office 365 distribution group is set up by the administrator in order to send any invitation or message to the group’s members using the same email address. There are situations where the administrator needs to rebuild the distribution group using its members or require the details of specific members in one group to be shared among several groups. In such a case, opening every distribution group and receiving the data via Exchange Admin Center in the Office 365 account with internet connection is not a good idea. However, having the information of members of the distribution group in a file such as CSV that is accessible at any time is a much more convenient option to keep information about members’ identities to use at any time. In this blog, you’ll discover the various ways for exporting Office 365 distribution group members to CSV file format.

Manually exporting Office 365 Participants of the distribution group to CSV

If you prefer manual methods, we’ve got two options for exporting Office 365 distribution group members to CSV format. :

  1. PowerShell scripts: This technique involves running scripts to aid in exporting and requires expertise in the running of PowerShell scripts. A novice user may be unable to run the scripts on the very first attempt and requires prior knowledge to be able to achieve the desired results.
  2. Exchange Admin Center Console: This method is fairly straightforward and does not require any expertise for full process’s execution. However, users must be aware and follow the explained step in a sequence. It also includes an Exchange Admin Center console in-built features that allows the export of members of the distribution group to CSV format.

Related Blog: What to Do When Office 365 Shared Mailbox Not Showing in MS Outlook?

In this short introduction to the two manual methods for exporting Office 365 distribution group members to CSV It will be easy to decide which one of the two previously mentioned. However, here, with no preference, we’ll go over the methods that are included in both techniques one after the other.

Export Office 365 Distribution Group Members to CSV – PowerShell Scripts

The first requirement is running Windows PowerShell as an administrator and then connecting Exchange Online to PowerShell with the assistance of the these steps.

1. The first command is for connecting Exchange Online to Windows PowerShell –

Set-ExecutionPolicy RemoteSigned

2. The next command to run could be

$UserCredential = Get-Credential

This command will produce an ad-hoc prompt to enter your Office 365 account login credentials. Enter them and click OK.

3. Join the session by using this command

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

4. The command that you must be executed in order to link Exchange Online to Windows PowerShell is as follows:

Import-PSSession $Session -DisableNameChecking

Once this last command has been executed, Exchange Online is successfully configured in Windows PowerShell. Follow the following instructions and scripts to complete the export of distribution groups.

To find out more regarding the distribution groups available within Your Office 365 organization, run this command.

Get-UnifiedGroup -ResultSize Unlimited

The command execution will display all Office 365 groups in the company. You can see the groups that are required for export here.

Now that you are aware what groups are, it is important to be aware of who is in the group prior to export. Use the following command to do this.

Get-UnifiedGroupLinks – Identity – LinkType Members – ResultSize Unlimited

You will be able to access the group’s members list in the process.

NOTE: To list all members of all Office 365 Distribution Groups for the account, users may execute the script below.

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 you’ve decided which members of the distribution group you wish to export to a CSV file, execute this command next.

Get-DistributionGroupMember -Identity | Select Name, PrimarySmtpAddress | Export-csv members.csv -NoTypeInformation

It can directly export members of the distribution group to CSV format. It will then include specifics of the information such as DisplayName and Group’s Primary Email Address, Member Email Members Type, Alias Group, Type Group Type, Owner(Managed by) Members Count Members, etc.

If you are looking to transfer the members from all Office 365 groups to CSV file format, you can use the following 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. Log into the account in your Office 365 account with global administrator credentials. Select the Admin option and then select the Exchange option under the Admin Centers section in the left pane of the Office 365 admin center.

2. In the Exchange Admin Center page, select Recipients and then click on Groups.

3. Choose the distribution group you want to join and click on the 3 dots (More) option. Select exporting data to CSV file. CSV option.

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

4. In the open Export data window, click the column and then click on Export.

5. The members of the distribution group will be exported to CSV file format.

What data will the the exported CSV file contain?

The resultant CSV file will be presented in a table format with the relevant information like Distribution Display Names Group Names, Group Names, Members Names of Groups, Aliases of Groups Principal SMTP Email Address members count, Member Count according to the type of recipient, authorized senders and allows External Recipient.etc. The information is based on the chosen number of members of the Distribution Groups in Office 365.

Both solutions can be executed and require different skills, however the time required to complete them is always an issue. The process of converting Office 365 distribution group members to a CSV file is an excellent effort to keep a record of the members available for anytime analysis and usage. For complete Office 365 data backup including emails, contacts, addresses, etc. Try the automated Office 365 backup tool. It will save or backup your desired Office 365 data to Outlook PST file format , which you can then save as backups to Office 365 data. The interface for the software is user-friendly and is suitable for all kinds of users, novices or expert. Take advantage of the offer quick to meet your needs.