OR condition in O365 DynamicDistributionGroup

Can someone help me with the syntax to add an "OR" condition? 

I have a DynamicDistributionList with 2 conditions:   StateorProvidence -eq Chicago AND Department-Sales

(THIS PART WORKS FINE AND I HAVE MY GROUP)

However, I want to add other condition (an OR condtion) to add all part timers in Chicago to the group: StateorProvidence -eq Chicago AND CustomAttribute1 -eq Parttime

I can't quite get the right syntax and parentheses right.  Can someone advise?  THANK YOU!

Set-DynamicDistributionGroup -Identity "All Chicago Sales"
-RecipientFilter {(((RecipientType -eq 'UserMailbox') -and ((StateOrProvince -eq 'Chicago' and Department eq
Sales)) -or ((StateOrProvince -eq 'Chicago' and CustomAttribute1 eq
Parttime)))}

February 12th, 2015 7:02pm

This one works for me:

Set-DynamicDistributionGroup DDG -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (StateOrProvince  -eq "Sofia") -and ((Department -eq "Mer
cedes") -or (CustomAttribute1 -eq $null)))}

Just change your attribute values accordingly.

Free Windows Admin Tool Kit Click here and download it now
February 13th, 2015 3:42am

Hi,

Please try:

Set-DynamicDistributionGroup -Identity "All Chicago Sales" -RecipientFilter {((RecipientType -eq 'UserMailbox') -and (StateOrProvince -eq 'Chicago') -and ((Department -eq 'Sales') -or (CustomAttribute1 -eq 'Parttime')))}

Regards,

February 13th, 2015 4:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics