When adding a contact to Exchange Online, you may find the need to assign an email address to your tenancy’s domain, that both internal and external senders use. You would think that just setting the Alias would automatically make an SMTP address available, but this is not the case. These email addresses need to be set with PowerShell. An alternate method to achieve the same goal would be to make two contacts, one for the internal email address and one for the external, then a hub transport rule to forward them. The hub transport method will work, but adds quite a bit of complexity and overhead for such a simple goal.

Below is an example of this case, and the command required to set the contact’s email address under your existing domain.

User John Doe works with The Client, but does not need a mailbox. John requires an email address of jdoe@theclient.com, which forwards to his john@doe.com external email address.

Create a new contact with the GUI, or via the New-MailContact cmdlet. Even though you set the Alias, the @theclient.com email address is not automatically created. You must use PowerShell to set the MailContact’s EmailAddresses.

Set-MailContact –Identity jdoe –EmailAddresses SMTP:jdoe@theclient.com,john@doe.com

Now any messages sent to jdoe@theclient.com will automatically be forwarded to john@doe.com. You can then modify additional settings, such as hiding the contact from the GAL.