So you have generated users in your ad that you want to move to Office 365.

Before you dirsync the user to the Cloud you can change mail-attribute.

But after the user in synced to Office365 you cannot do this anymore.

If you are too late you have to add or modify the ProxyAddresses and it will change the primary smtp-address in Office356 (SMTP is primary and smtp is secondary!)

** Edit 14.8.2017 – Wrong syntax in script **

First:

Then edit csv and change old domain to new domain.
Then:

 Powershell rocks!