Setup Dynamic Distribution list based on City Name

Copper Contributor

Hi

 

I just want to create two dynamic distribution list 

 

For the first distribution list , if the user based in a city called Auckland the user is moved to the distribution list.

I also want another distribution list called "all staff" and anyone new and existing users will be added to the distribution list.

 

I'm reading this https://learn.microsoft.com/en-us/exchange/recipients/mailbox-custom-attributes?view=exchserver-2019...and I'm very lost

 

Is there a quick way of doing this?

3 Replies
You can use something like this:

New-DynamicDistributionGroup Auckland -RecipientFilter {City -eq 'Auckland'}

For the "all staff" scenario, you have to come up with a suitable rule, as there are many corner cases to consider. For example, you can have a DDG with all mailboxes, but that will include shared/room mailboxes as well. Then there's the question of whether disabled users should be included, and even what "staff" is...
How do you enter the rule though?
I'm in exchange and I can see a list of options to select.

For example, department, province, custom attribute 1, custom attribute 2.... Custom Attribute 15.

I can't pick or write a syntax rule or pick a field under contact information of a user in Azure ad