Office 365 Powershell – changing email address (dirsync solution as well)

I have been working away at this to find a simplified way to change over email addresses during migration, it has taken lots of time to get to today.
So I found a way today to change email addresses very quickly for shared mailbox scenario’s.
First of all you need to connect to Exchange Online.  (
These commands need the connect-msonline
Note also some very good instructions also at
Now the next part changes the UPN, this is exactly the same as doing it on-premise AD (as per my previous post ) .

Set-MsolUserPrincipalName -UserPrincipalName “” -NewUserPrincipalName “”

This sets the UPN and email address up for you! Nice!
The next step is to set the default reply address

Set-Mailbox -WindowsEmailAddress

Job done !  Easy !

Leave a Reply

Your email address will not be published. Required fields are marked *