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 -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 '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')))
- You should be grouping similar clauses together, via parenthesis, otherwise the logic gets broken. So:
(blabla) -and ((RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact'))
6 Replies
Sort By
- SunfieldPaulCCopper Contributor
I have tried stripping back the filter but still cannot get it to exclude accounts with the exclude custom attribute set.
set-dynamicdistributiongroup -identity "Everyone" -RecipientFilter "((((CustomAttribute1 -ne 'EXCLUDE') -or (ExtensionCustomAttribute1 -ne 'EXCLUDE')) -and (RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact')) -and (-not(Name -like 'SystemMailbox{*')))"
- You should be grouping similar clauses together, via parenthesis, otherwise the logic gets broken. So:
(blabla) -and ((RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact'))
- Update/remove the RecipientType clause, as you're currently only including mailboxes.
- SunfieldPaulCCopper Contributor
What would be the attrib just to add contacts as I don't want to include anything other than mailboxes and contacts?
- You can use something like:
(RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact')