Exchange Online: Cannot replace PrimarySMTPAddress of a mailbox

You try to replace the Primary email address (PrimarySMTPAddress) OR a secondary email address/Alias on a mailbox in Exchange Admin Center. After replacing the email address, you save the changes. Reopen the mailbox properties, you see the FREAKING primary email address still FREAKING there.

I am sure you tried to replace the email address using

Set-Mailbox -Identity MailboxName -PrimarySMTPAddress

Command runs and no errors seen. BUT the PrimarySMTPAddress is still FREAKING there. What the HELL is going on here?

Here is the solution: Replace WindowsEmailAddress and MicrosoftOnlineServicesID with the new email address first on Mailbox properties, then modify the PrimarySMTPAddress. Here are the sample PowerShell cmdlets:

Set-Mailbox -Identity MailboxName -MicrosoftOnlineServicesID
Set-Mailbox -Identity MailboxName -WindowsEmailAddress
Set-Mailbox -Identity MailboxName -PrimarySMTPAddress

If you are changing the secondary email address/alias, use this cmdlet:

Set-Mailbox -Identity MailboxName -EmailAddresses @{Remove=""}
Set-Mailbox -Identity MailboxName -emailAddresses @{Add=""}

Hope that was as easy as this solution. Enjoy!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s