Office 365 dynamic distribution list

Posted on 2016-07-21
Last Modified: 2016-08-22
My company has several domains registered with Office 365. I need to create distribution lists for each domain that includes all users for that domain (i.e.,, etc.). I would like the list to be dynamically updated so that we aren't manually adding users to the list every time an account is created. Is this possible?
Question by:Christopher Perry
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 41724041
Dynamic Distributuion Group

Author Comment

by:Christopher Perry
ID: 41724043
David, wouldn't this solution require manually defining the "Custom attribute 1" value for every user upon creation?
LVL 41

Expert Comment

by:Vasil Michev (MVP)
ID: 41724047
Should be possible via something like this:

Set-DynamicDistributionGroup domain -RecipientFilter {((Alias -ne $null) -and (UserPrincipalName -like "*"))}

However, it will error out saying wildcards are not allowed. While the same syntax will work perfectly fine for address lists. I've asked the team to clarify on this...

If it turns out wildcards are not supported indeed, your other option is to populate some of the extension attributes and filter on those. However, it's pretty much the same as adding all mathing users manually to a DG, so not really a solution here.
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 41724070
Yes since I only want 1 domain in that DDG when I create it otherwise it will apply to all domains. Once created it just works
LVL 41

Accepted Solution

Vasil Michev (MVP) earned 500 total points (awarded by participants)
ID: 41725559
Unfortunately, this is by design - you cannot use leading wildcards in EO. Here's the documentation on it:

The RecipientFilter parameter specifies an OPath filter that's based on the value of any available recipient property. You can use any available Windows PowerShell operator, and wildcards and partial matches are supported. When you use this parameter, remember the following OPath filter rules:

Use braces { } around the whole OPath syntax string.

Include a hyphen before all operators.

In cloud-based environments, you can't use a wildcard as the the first character. For example, Sales* is allowed, but *Sales isn’t allowed.

Author Comment

by:Christopher Perry
ID: 41730566

You confirmed my fear... I'm going to mark your answer as correct if I don't hear any other solutions in the next 48 hours.

Thank you!
LVL 81

Expert Comment

by:David Johnson, CD, MVP
ID: 41756098
Asker was going to accept and then come back

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In-place Upgrading Dirsync to Azure AD Connect
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question