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.
VasilMichev
Nov 22, 2023MVP
As mailboxes can have multiple SMTP address (from different domains) assigned, its best to use something like the UPN value instead:
UserPrincipalName -like '*@domain.com'
but EmailAddresses would also work
EmailAddresses -like '*@domain.com'
UserPrincipalName -like '*@domain.com'
but EmailAddresses would also work
EmailAddresses -like '*@domain.com'
pcryanBC
Nov 22, 2023Copper Contributor
Thank you Kidd_IP and Vasil Michev - exactly what I was looking / hoping for.
Much appreciated.
Much appreciated.