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.
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?
- stevenb2440Oct 10, 2024Copper Contributor
I have encountered this exact issue. I had two groups using this sort of syntax. One still works. The other one I tried to edit and no longer works.
Also, if I take the filter from the one that works and try to create a new group based on that filter, it also doesn't work. Comparing the RecipientFilter attribute from the groups with powershell showed they are exactly the same.
Unfortunately, it looks like Microsoft have broken this syntax for newly created or edited groups. Why it still works for the old group I'm not sure, but I'm sure if I tried to make a change to it, it will probably break too.
I'm now a bit stuck because I seemingly don't have any way to fix the group that was working previously.
- AndreiM1295Aug 06, 2024Copper Contributor
Better yet I had the set command saved and just changed the name of the DDL while applying the same filter.