Creating a Dynamic Distribution list based on users email domain

dej 6 Reputation points
2024-08-07T08:22:06.6033333+00:00

I have tried creating a Dynamic Distribution list using the following PS script

New-DynamicDistributionGroup -Name "O365_DDG_All-Test" -RecipientFilter "(RecipientTypeDetails -eq 'UserMailbox') -and (WindowsLiveID -like '@test.com')"

But it just is not working, I would like to create a Dynamic Distribution list based on the users email domain - any tips as to what I may be doing wrong.

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,494 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Noah Ma-MSFT 2,725 Reputation points Microsoft Vendor
    2024-08-08T09:02:29.44+00:00

    Hi @dej,

    Welcome to the Microsoft Q&A platform!

    As Pawel Jarosz said, please try to change the -like to -eq and use the wildcards to see if it works.

    Also, it is recommended to consider the alternative approach in How to Create Dynamic Distribution Groups Using Email Addresses (practical365.com) since the uncertainty around using email properties in recipient filters.

    Please Note: Since the web site is not hosted by Microsoft, Microsoft does not guarantee the accuracy of this information.

    If you have anything else need help from me, please feel free to contact me.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.