How do you exclude a specific email address from a dynamic distribution group in exchange 2010?

Posted on 2014-08-22
Last Modified: 2014-08-23
I'm trying to find the exact command to use in powershell to remove a user from a dynamic distribution list called "Everybody."  I found some examples on the web but I must be doing something wrong because it doesn't work. Can someone point me in the right direction? Thanks in advance.
Question by:jburnerducks
    LVL 4

    Expert Comment

    by:Andy Navi

    You can exclude a specific user from a DD group with the Set-DynamicDistributionGroup commandlet. Specifically with the -RecipientFilter option.

    Example: Set-DynamicDistributionGroup -Identity MadeUpName -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(Name -like 'Journal User'))}

    Note that this example is just with recipient type = userMailbox. You can get the current recipientFilter of your DD group and modify it however from powershell.

    (get-DynamicDistributionGroup -Identity MadeUpName).RecipientFilter

    LVL 4

    Expert Comment

    by:Andy Navi

    Author Comment

    Thanks Andy,
    What's the proper syntax if I wanted to add 3 users at a time? Would it be: Set-DynamicDistributionGroup -Identity MadeUpName -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(Name -like 'Journal User1')) -and -not(Name -like 'Journal User2')) -and -not(Name -like 'Journal User3'))} ?
    I ask that because I tried to add one name at a time, but each time I typed the command it overwrote the filter.
    LVL 4

    Accepted Solution


    Yes you are correct, here is the Example

    Set-DynamicDistributionGroup -Identity DDGName -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(Name -like 'Display Name 1') -and -not(Name -like 'Display Name 2') -and -not(Name -like 'Display Name 3') -and -not(Name -like 'Display name etc.'))}


    Author Closing Comment

    Thanks Andy, that worked!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why do Marketing keep bothering you?

    Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

    Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
    Use email signature images to promote corporate certifications and industry awards.
    The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now