Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was able to remove one user using this command:

Set-DynamicDistributionGroup -Identity "All Staff" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and -not(Name -like 'Employment'))} 

But I have more than one mailbox that I want to remove. Is it possible to add another mailbox into the above command?

share|improve this question

Unless there is some common property you can use to filter against all the recipients you have to exclude, you will need to exclude them one by one using multiple exclusion filters.

share|improve this answer
Matt, Thank you. – Harbert Tom Jan 8 '13 at 5:32
This is the command used in case someone else needs help: 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.'))} – Harbert Tom Jan 8 '13 at 5:33

A manageable solution would probably be one that meant you didn't have to keep coming back to change the recipient filter every time a new candidate for exclusion was created.

I had to implement a recipient filter the other day for a management scope. The filter was based on a security group. So from the security group angle, you could create a security group and manage your exclusions using that. For example, your filter would look like:

{((RecipientType -eq 'UserMailbox') -and -not(MemberOfGroup -eq 'AllStaff_Exclusion_Group'))}

Equally, you could just use the SG to include staff members, removing the need for a complicated filter.If it helps, heres a list of all filterable properties. There are many, so it's possible you could find one that your excluded recipients have in common.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.