It’s easy to Set the Primary Email Address on Office 365 with PowerShell using the Set-Mailbox cmdlet. The primary address is defined using “SMTP” in uppercase in the email address. For example:
Set-Mailbox -Identity "test.user" -EmailAddresses SMTP:email@example.com,smtp:firstname.lastname@example.org
Note: The Set-Mailbox cmdlet will remove all existing aliases, so include them with the command.
Enter the details of the mailbox to be changed in the form below, and PowerShell code will be generated. It includes the required PowerShell to connect to Office 365.
Set the Primary Email Address on Office 365 using Powershell
Set the Primary Email Address on Office 365 when the user is being managed by the local active directory
The steps above will work if the user that you are changing is cloud managed. If your accounts are synchronised from your local active directory, then they will be out of the write scope of Office 365. If that is the case please follow the instructions on this page: