Hi, I have DDG in my environment called Everyone - it contains all users with Exchange mailboxes. There is a need to exclude one mailbox from this DDG.
Get-DynamicDistributionGroup -Identity everyone | Select-Object RecipientFilter command returns:
((RecipientType -eq 'UserMailbox') -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'C
AS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValu
e -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))
But after I run the following command (the same filter as before with addition of mailbox I want to exclude from DDG):
Set-DynamicDistributionGroup -Identity everyone -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')) -and (-not(Name -like 'experience*')))}
now Get-DynamicDistributionGroup -Identity everyone | Select-Object RecipientFilter command returns:
((((((((((((((RecipientType -eq 'UserMailbox') -and (-not(Name -like 'SystemMailbox{*')))) -and (-not(Name -like 'CAS_{*')))) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')))) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')))) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))) -and (-not(Name -like 'experience*')))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))
I went over Preview and mailbox was excluded from DDG but what is wrong with RecipientFilter syntax above - too many parenthesis and duplicate entries????