In some situations, we have to Export all the Distribution group/Unified Groups and all the members of it to a CSV file. There is no command let available to retrieve the distribution group and distribution group members in bulk. The pipeline won’t work in this case.
****2021 Export all Unified Groups as well***
**** Export all the Distribution group and Distribution Group managers as well***
***Export all the Dynamic Distribution group and Dynamic Distribution Group managers as well***
Primary SMTP address
Distribution Group Primary SMTP address
Distribution Group Managers
Distribution Group OU
Distribution Group Type
Distribution Group Recipient Type
Not Allowed from the Internet
I have written a script that will make Exchange Administrators’ life Easy to export distribution group and its members.
Requires Exchange Management Shell – For Option 9 and 10 you will need Exchange Online Shell
.\DistributionGroupMemberReport.ps1 – It Can Display all the Distribution Group and its members on a List
Or It can Export to a CSV file
Browse the Shell to the Appropriate Location
Run it as above
The output of the CSV file looks like Below
You can add some more entries if required
How to use this Script for Office 365 –
Local desktop. PowerShell – Run as Administrator
Make Sure your Execution Policy is set to RemoteSigned or Unrestricted
my Case is unrestricted.
To Get Execution Policy Status
Now Run the Script – It should work.