Link to home
Start Free TrialLog in
Avatar of jburnerducks
jburnerducks

asked on

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

Hello,
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.
Avatar of Andy Andy
Andy Andy
Flag of India image

Hi,


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


Thanks,
Avatar of jburnerducks
jburnerducks

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Andy Andy
Andy Andy
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Andy, that worked!