Dynamic distribution group with custom attributes

New Contributor

Hi, we have a hybrid environment on Office 365 and we have split the company 2 different companies, so the name of the Company was setup to distribute mail with Dynamic distribution group. I have changed the "Primary" company name to the Company in distibution list and then tried to add Custom attribute 1 "Auto" to users from the "Secondary" company and then added rule Custom attribute 1 to the Dynamic group rule "Auto" but when user send email, both companies does not receive no email. after removing the second rule, it is working but only for "Primary" company. Do i do something wrong? Also i have add one user to different group with Custom attribute 1 and there is it working without problem. 


Thanks for comments 

3 Replies
I'm at loss here, which "rules" exactly are you referring to? Membership of DDGs is determined by recipient filters, and the conditions you specify there are applied in logical AND configuration, so that's probably what's causing the issue for you. You can use a logical OR configuration if you configure the filter via PowerShell and the Set-DynamicDistributionGroup cmdlet.

Maybe I have my self expressed not the right way, but I want to achieve that the mail is send to all users in this dynamic distribution group based on Company name. Like I said, we have split the company to two different names but for now I want only have one Dynamic group which is sending email to users in both Companies. The users are still in same OU the only difference is the Company name. So i would like do it with custom attribute but apparently is it not working. Is it because the the "rules" are created with "and" not "or" conditions? is it a litte bit more clear?

Yes, it's clearer now. When you are using the UI, the "rule" is always created with a logical "and" configuration. Use PowerShell instead:

Set-DynamicDistributionGroup DDGName -RecipientFilter "CustomAttribute12 -eq '55555' -or CustomAttribute15 -eq 'Teams'"