Forum Discussion
SunfieldPaulC
Nov 07, 2022Copper Contributor
Trying to update old dynamic distribution group to include exchange contacts
Im trying to update an old dynamic distribution group to include exchange contacts. Can anyone help with this? ((((((((((((((((((((((CustomAttribute1 -ne 'EXCLUDE') -and (RecipientType -e...
- Nov 08, 2022You should be grouping similar clauses together, via parenthesis, otherwise the logic gets broken. So:
(blabla) -and ((RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact'))
VasilMichev
Nov 07, 2022MVP
Update/remove the RecipientType clause, as you're currently only including mailboxes.
SunfieldPaulC
Nov 07, 2022Copper Contributor
What would be the attrib just to add contacts as I don't want to include anything other than mailboxes and contacts?
- VasilMichevNov 08, 2022MVPYou can use something like:
(RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact')- SunfieldPaulCNov 08, 2022Copper Contributor
I have added the mail contacts but for some reason it is ignoring the EXCLUDE in the custom attribs. Any ideas?
set-dynamicdistributiongroup -identity "Everyone" -RecipientFilter "((((((((((((((((((((((CustomAttribute1 -ne 'EXCLUDE') -and (RecipientType -eq 'UserMailbox'))) -or (RecipientType -eq 'MailContact')-and (-not(Name -like 'SystemMailbox{*')))) -and (-not(Name -like 'CAS_{*')))) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')))) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')))) -and (-not(RecipientTypeDetailsValue -eq 'PublicFolderMailbox')))) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')))) -and (-not(RecipientTypeDetailsValue -eq 'AuditLogMailbox')))) -and (-not(RecipientTypeDetailsValue -eq 'AuxAuditLogMailbox')))) -and (-not(RecipientTypeDetailsValue -eq 'SupervisoryReviewPolicyMailbox')))) -and (-not(Name -like 'SystemMailbox{*')) -and (-not(Name -like 'CAS_{*')) -and (-not(RecipientTypeDetailsValue -eq 'MailboxPlan')) -and (-not(RecipientTypeDetailsValue -eq 'DiscoveryMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'PublicFolderMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'ArbitrationMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'AuditLogMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'AuxAuditLogMailbox')) -and (-not(RecipientTypeDetailsValue -eq 'SupervisoryReviewPolicyMailbox')))"