New-DistributionGroup

Rising Flight 5,256 Reputation points
2025-08-27T05:05:15.0066667+00:00

I am using an Exchange hybrid environment and would like to create a Distribution List (DL) in Exchange Online using PowerShell. For example, let’s say the DL name is DLEXO1 and the email address is DLEXO1(at)mydomain.com. I already have Exchange 2019 DLs that are synced to Exchange Online.

Before creating the new DL, I want to validate whether there already exists any other Distribution List (On-premises/Online), Unified Group, Shared Mailbox, User Mailbox, or Room/Resource Mailbox, Booking mailbox with the same Name, Alias, Display Name, Primary SMTP address, or Additional SMTP address.

I would also like to validate email addresses against both mydomain.com and mydomain.onmicrosoft.com. Ideally, I want to run a PowerShell script that provides an output such as “No conflict found” so that I can safely proceed with the following command.

I want to ensure that the DL I am creating does not conflict with any existing identity in my environment.

New-DistributionGroup -Name "DLEXO1" -Alias "DLEXO1" -DisplayName "DLEXO1" -PrimarySmtpAddress "DLEXO1(at)mydomain.com" -ManagedBy "user1"

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
{count} votes

1 answer

Sort by: Most helpful
  1. Jade-T 4,315 Reputation points Microsoft External Staff Moderator
    2025-08-27T08:48:15.8833333+00:00

    Hi @Rising Flight

    Thanks for reaching out. You’re absolutely right that checking for conflicts is an important step before creating a new Distribution Group. 

    According to Microsoft's documentation, running a lookup across all recipient types is the most reliable method. This ensures that the Name, Alias, Display Name, or SMTP Address you plan to use isn’t already assigned to any of the following: 

    • User mailboxes 
    • Shared/Resource mailboxes 
    • Distribution Groups 
    • Microsoft 365 (Unified) Groups 

    Here are some sample commands you can run: 

    # Check by identity 
    Get-Recipient -Identity "DLEXO1" 
    
    # Check by email address (both domains) 
    Get-Recipient -Filter "EmailAddresses -like '*******@mydomain.com*' -or EmailAddresses -like '*******@mydomain.onmicrosoft.com*'" 
    

    This will check if the alias, display name, or email address (under both mydomain.com and mydomain.onmicrosoft.com) already exists. 

    • If the command returns nothing, it means no conflicts were found, and you can safely proceed with your New-DistributionGroup command. 
    • If results are returned, another object is already using that value, and you’ll need to choose a different name or address. 

    For further reference, here are the official docs: 

    I hope this helps you move forward with confidence. Please let me know if you have any other questions. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.