Export DLs and Unified groups

Rising Flight 5,216 Reputation points
2020-12-10T01:47:17.563+00:00

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.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,172 questions
Microsoft 365 and Office | Office Online Server
Exchange | Exchange Server | Management
{count} votes

Accepted answer
  1. Joyce Shen - MSFT 16,701 Reputation points
    2020-12-11T01:44:26.063+00:00

    Hi @Rising Flight

    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.
     

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.