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.
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:firstname.lastname@example.org,email@example.com
Now any messages sent to firstname.lastname@example.org will automatically be forwarded to email@example.com. You can then modify additional settings, such as hiding the contact from the GAL.