Forum Discussion
Can a Dynamic Distribution list group be created that uses a specific SMTP domain as the filter?
- Nov 23, 2023Hm, I hate it when I've overlooked something and Tony gets to be right 😄 Nope, we cannot use -like due to the limitation Tony mentioned. I do however have a working domain-based DDG, with the following filter:
(Get-DynamicDistributionGroup domain).RecipientFilter
((WindowsLiveID -eq '*@michev.onmicrosoft.com')
WindowsLiveID here can be used as a replacement for UPN, and does work for the filter:
[09:34:55][O365]# Get-DynamicDistributionGroupMember domain
Name RecipientType
---- -------------
HuKu UserMailbox
michev_gmail.com#EXT# MailUser
Apologies about the confusion, should have actually checked my setup first.
(Get-DynamicDistributionGroup domain).RecipientFilter
((WindowsLiveID -eq '*@michev.onmicrosoft.com')
WindowsLiveID here can be used as a replacement for UPN, and does work for the filter:
[09:34:55][O365]# Get-DynamicDistributionGroupMember domain
Name RecipientType
---- -------------
HuKu UserMailbox
michev_gmail.com#EXT# MailUser
Apologies about the confusion, should have actually checked my setup first.
I wrote up the details of this issue because I wanted to share them with Microsoft engineering. Here's the text:
Creating Dynamic Distribution Lists Based on Email Addresses
Exchange Online recipient filters calculate the membership of dynamic distribution groups. The filters support email addresses, but they don't work. Another method is needed to create dynamic distribution lists based on user mailbox email addresses, as we describe in this article and script.
https://practical365.com/dynamic-distribution-lists-email-address/
- pcryanBCJan 08, 2024Copper Contributor
TonyRedmond It’s not often you ask a question online and get such a series of impressive thoughtful replies. Color me impressed - and appreciative.
- TonyRedmondJan 08, 2024MVPWell, helping the community is something that MVPs are supposed to do. Vasil does a much better job of this than I do, but when I become interested in an issue, I do like to think about how things work and figure out if we can do better.
- AndreiM1295Aug 05, 2024Copper Contributor
2 weeks ago i implemented a custom filter for DDL following the helpfull insight you provided in your article.
I used the recipientfilter {((recipienttypedetails -eq 'usermailbox') -and ((WindowsLiveID -eq '*@domain1.com') -or (WindowsLiveID -eq '*@domain2.com') - or (WindowsLiveID -eq '*@domain3.com') -or (WindowsLiveID -eq '*@domain4.com')))}, and the DDL worked as expected, it filtered from all the mailboxes only the ones from domain1,2,3, and 4 and contains aprox 54k members.
One week later I have tried to create another group using the recipientfilter as the one mentioned above, and something very strange happens, the newly created group which has the same filter as the one that worked, doesn't contain any members.
Now I have tried searching online for any kind of possible explanation as to why the 2nd group doesn't accept the same filter and came out empty handed.
Have you ever encountered something similar?