Share via

Query Distribution list

Glenn Maxwell 13,721 Reputation points
2023-08-20T07:42:31.5733333+00:00

Hi All

I have dynamic Distribution lists in exchange online. I want to export those DDLs list to csv file. i.e Group Name, Group Email address and if possible Members i.e Recipient filter Query.(I dont wants members list, only the query used). Please guide me with the syntax. I am trying something like the below but i am not getting correct output.

(get-dynamicdistributiongroup).RecipientFilter -OrganizationalUnit $group.RecipientContainer | Select Displayname,alias,PrimarySmtpAddress | Export-Csv "c:\temp\list.csv" -Notypeinformation

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management

The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.

Exchange | Hybrid management
Exchange | Hybrid management

The administration of a hybrid deployment that connects on-premises Exchange Server with Exchange Online, enabling seamless integration and centralized control.


Answer accepted by question author

  1. Jarvis Sun-MSFT 10,286 Reputation points Microsoft External Staff
    2023-08-21T05:51:57.9166667+00:00

    Hi @Glenn Maxwell ,

    You can connect to Exchange Online powershell and run the command below, I have tried in my environment it can work properly:

    Get-DynamicDistributionGroup | Select DisplayName, Alias,PrimarySmtpAddress,RecipientFilter | Export-Csv "C:\temp\list.csv" -Notypeinformation
    

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    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.

    Was this answer helpful?

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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