mail contact syntax

Roger Roger 5,046 Reputation points
2024-06-12T04:45:45.5466667+00:00

Hi all,

I want to create a mail contact using Exchange Online PowerShell. Is the syntax below correct? Let's say my domain is contoso.com. I have an external user whose alias is someuser@somedomain.com. On my side, if I choose the alias as someuser.ext, will it create someuser.ext@contoso.onmicrosoft.com or someuser@contoso.com? I want it to be someuser@contoso.com.

New-MailContact  -FirstName "FN" -LastName "LN Ext" -DisplayName "FN-LN Ext" -Alias someuser.ext -ExternalEmailAddress someuser@somedomain.com

Microsoft Exchange Online
Exchange Server
Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,162 questions
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,338 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,969 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xintao Qiao-MSFT 790 Reputation points Microsoft Vendor
    2024-06-12T09:47:07.9533333+00:00

    Hi, Roger Roger

    With the command you provided, the syntax is correct through my tests, and I have successfully created a mail contact. The result is shown below.

    6.12

    When you create an alias for external users in your domain, the resulting email address typically follows the primary domain format that you set up for your organization in Microsoft 365.

    If your primary domain is contoso.com, then the alias you create will often generate an email address like someuser.ext@contoso.com.

    If my answer is helpful to you, please mark it as the answer so that other users can refer to it. Thank you for your support and understanding.