Forum Discussion
pcryan5220
Nov 21, 2023Copper Contributor
Can a Dynamic Distribution list group be created that uses a specific SMTP domain as the filter?
Our corporate Microsoft 365 Exchange environment has users with different SMTP addresses. (e.g., @ work1.com @ work2.com etc.). Can a Dynamic Distribution list group be created that uses a speci...
- 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.
TonyRedmond
Nov 22, 2023MVP
Wildcards can't be used as the first character in a DDL filter... At least, I have never been able to make this work.
- VasilMichevNov 23, 2023MVPHm, 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.- TonyRedmondNov 23, 2023MVPThe key thing here is that you're using the equals operator instead of like (-eq versus -like). AFAIK, this works for WindowsLiveID but not for any of the other filterable properties that store email addresses.
- TonyRedmondJan 08, 2024MVP
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.