get-aduser old mail-attribute and set-aduser to a new one and keeping the old prefix.

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 **


Then edit csv and change old domain to new domain.

 Powershell rocks!
Author: Harri Jaakkonen

Leave a Reply

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