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'))
SunfieldPaulC
Nov 08, 2022Copper 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{*')))"
VasilMichev
Nov 08, 2022MVP
You should be grouping similar clauses together, via parenthesis, otherwise the logic gets broken. So:
(blabla) -and ((RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact'))
(blabla) -and ((RecipientType -eq 'UserMailbox') -or (RecipientType -eq 'MailContact'))