question

RisingFlight-7863 avatar image
0 Votes"
RisingFlight-7863 asked joyceshen-MSFT commented

Export DLs and Unified groups

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.

office-exchange-server-administrationoffice-exchange-online-itprooffice-online-server-generaloffice-online-server-exchange
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RisingFlight-7863

Do suggestions below help?

0 Votes 0 ·

Hi @RisingFlight-7863

Have you tried the commands below?

0 Votes 0 ·

1 Answer

joyceshen-MSFT avatar image
0 Votes"
joyceshen-MSFT answered

Hi @RisingFlight-7863

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:

47231-qa-2020-12-11-09-39-49.png
47241-qa-2020-12-11-09-40-50.png


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.
 


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.