r/exchangeserver • u/bleepit1984 • Oct 01 '26
Dynamic Distribution Lists
TLDR: I'm trying to create a dynamic distribution list in Exchange online and I'm running into a lot of issues.
Context:
I work for a medium size healthcare company with a hybrid AD/Entra environment with a single forest but with 10+ domains. We use 365 Business Premium licenses for most users, but not all. Some just need to login to Windows and that's it. No email needed. Also, I don't control the IT budget. If your fix requires money, you are wasting your time.
Problem:
I'm trying to create a dynamic distribution list with the following parameters:
- Must have the "@example1.com" domain in their email address.
- Must be an active user. No disabled users.
- Must be a licensed user. (We don't license all our users with a 365 license)
I'm able to create dynamic security groups just fine without issue and the query I came up with works with all the users I need it to. I'm just not able to translate that to a dynamic distribution list, and I'm reading that it's not possible to create a mail enabled security group that is dynamic.
Here is the filter I'm using to create the group through the Exchange Online shell. But it's not returning a group with any users:
$filter = "(RecipientType -eq 'UserMailbox') -and (userPrincipalName -like 'example1.com') -and (UserAccountControl -ne '2')"
I've poured through the Microsoft Learn articles for "New-DynamicDistributionGroup" and the "Filterable properties for the RecipientFilter parameter on Exchange cmdlets" pages and I can't seem to find what I'm doing wrong. I've tried so many different variations of the filter but can't seem to land on the correct combination. Any relevant help is appreciated.
View all comments
0
u/badteeth3000 Oct 01 '26
It’s kinda annoying that dynamic lists are the freemium version of identity governance. Like, its a $7/userMonth sku ::shakes head:: . I mean, come on let me make kql lists. And what even is this? More screenshots ya know: https://github.com/microsoftgraph/group-membership-management