How to update a Dynamic Distribution Group Recipient Filter?

The following is an example of the process and syntax I used to update a Dynamic Distribution Group to include mail enabled users:

  1. First, I got the original recipient filter details but running the following command

Get-DynamicDistributionGroup -Identity DDGName  |fl RecipientFilter

  1. I then took a copy of the original recipient filter which was as follows:

“((((RecipientType -eq ‘UserMailbox’) -and (((MemberOfGroup -eq ‘CN=grpUsers1,OU=Domain Groups,DC=domain,DC=ie’) -or (MemberOfGroup -eq ‘CN=grpUsers2,OU=Domain Groups,DC=domain,DC=ie’))))) -and (-not(Name -like ‘SystemMailbox{*’)) -and (-not(Name -like ‘CAS_{*’)))”

  1. I then added the MailUser and MailContact recipient type (highlighted in bold) to the recipient filter and used the Set-DynamicDistributionGroup with the following syntax to update the recipient filter:

Set-DynamicDistributionGroup -identity “DDGName” -RecipientFilter “((((RecipientType -eq ‘UserMailbox’) -or (RecipientType -eq ‘MailUser’) -or (RecipientType -eq ‘MailContact’) -and (((MemberOfGroup -eq ‘CN=grpUsers1,OU=Domain Groups,DC=domain,DC=ie’) -or (MemberOfGroup -eq ‘CN=grpUsers2,OU=Domain Groups,DC=domain,DC=ie’))))) -and (-not(Name -like ‘SystemMailbox{*’)) -and (-not(Name -like ‘CAS_{*’)))”

Source:
https://shanejacksonitpro.com/2018/09/12/how-to-update-a-dynamic-distribution-group-recipient-filter/

Be the first to comment on "How to update a Dynamic Distribution Group Recipient Filter?"

Leave a comment

Your email address will not be published.


*