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.  (https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx)
These commands need the connect-msonline
Note also some very good instructions also at Docs.com
https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-all-office-365-services-in-a-single-windows-powershell-window
 
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 “simon.allison@kentucky.com” -NewUserPrincipalName “simon.allison@contoso.com”

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

Set-Mailbox simon.allison@contoso.com -WindowsEmailAddress simon.allison@contoso.com

Job done !  Easy !
 
 
 
 

Leave a Reply