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 Name@newdomainname.com

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 name@newdomainname.com
Set-Mailbox -Identity MailboxName -WindowsEmailAddress name@newdomainname.com
Set-Mailbox -Identity MailboxName -PrimarySMTPAddress name@newdomainname.com

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

Set-Mailbox -Identity MailboxName -EmailAddresses @{Remove="oldemail@domain.com"}
Set-Mailbox -Identity MailboxName -emailAddresses @{Add="newemail@domain.com"}

Hope that was as easy as this solution. Enjoy!

Leave a Reply

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

WordPress.com Logo

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

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s