Hi All
i want to export all my distributions lists and unified groups with their display names and email addresses to csv file. experts please help me with the syntax to export them.
Hi All
i want to export all my distributions lists and unified groups with their display names and email addresses to csv file. experts please help me with the syntax to export them.
Try using the below command to export your DLs and o365 groups with their displaynames and email addresses to CSV
Get-DistributionGroup | Select DisplayName, PrimarySmtpAddress, EmailAddresses | Export-csv C:\test\DLs.csv -NoTypeInformation
Get-UnifiedGroup | Select DisplayName, PrimarySmtpAddress, EmailAddresses | Export-csv C:\test\Unifiedgroups.csv -NoTypeInformation
And the results show like below:


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
10 people are following this question.