Office365 - Adding alias for multiple users for custom domain

Hadrien Bailly 20 Reputation points
2023-04-04T15:44:48.06+00:00

Hi, my company is using Office365 under the Business Standard plan. We are using a custom domain as default, and we just added a new custom domain.
How can I create an alias for this new domain for all the active users ? Is there a way to do it directly when adding the new domain ? How about future new users : will we have to add manually aliases for each domains added ? Thank you

Windows for business Windows 365 Business
Microsoft 365 and Office Install, redeem, activate For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
    2023-04-04T15:57:58.2933333+00:00

    Unfortunately, you cannot automate this as Exchange Online does not support email address policies. Thus your best option is to use PowerShell. The solution will vary depending on whether you want to add the address as primary or secondary alias, but in both cases is fairly easy to do:

    Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | % {Set-Mailbox -WindowsEmailAddress $_.PrimarySmtpAddress.Replace("tenant.onmicrosoft.com","newdomain.com") }

    or

    Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | % {Set-Mailbox -EmailAddresses @{add=$_.PrimarySmtpAddress.Replace("tenant.onmicrosoft.com","newdomain.com")} }

    Make sure to replace the corresponding domain names, and of course, test against a user or two before running it across the company. Even better, expand these examples into a full-blown script with proper error checking and such. Here's one such example from Tony: https://office365itpros.com/2022/10/18/update-user-email-upns/

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.