Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 776 other subscribers


  • LinkedIn
  • RSS Feed for Posts
  • Twitter
  • StumbleUpon

O365 : On premise to cloud migration and Mail enabled user [SOLVED]

[Updated 8-8-2017]

How to decommission the old Exchange server, after migration to Microsoft Office 365.

This week I had to migrate an Exchange server to Office 365.

After the migration I had to remove the exchange software, but don’t want to remove the Exchange properties of the cloud users.

The trick in this option is convert the local synchronized users to mail enabled users.

After that you can decommission the old Exchange server safely


Pre requirements :


2 Create a backup of the active directory ( or export all data to csv : Export to csv )

3 First create a migration.csv file containing all of the users who need to be converted to mail enabled users:



Download the migration files from :






On the on premise Exchange server :

Execute to script .\ExportO365UserInfo.ps1 and Select ‘n’ to proceed

Enter your Office 365 credentials

Here you can read the message in green : CSV File Successfully Exported to cloud.csv

The created cloud.csv file contains all off the Exchange properties off all users you have placed in the migration.csv file

.\Exchange2007MBtoMEU.ps1 <FQDN of on-premises domain controller>

All users from the file cloud.csv are migrated to a Mail enabled user.

When checking the converted users, they are now mail enabled users.

The uses, are active in Office 365.

All off the Exchange properties are still available in Office 365.

It is now safe to decommission the old Exchange server, the online users are not affected anymore.

Check the local user for containing a proxyaddress in Active Directory

Don’t forget to activate the online sync again, when all is OK.

16 comments to O365 : On premise to cloud migration and Mail enabled user [SOLVED]

  • Adam


    In the above situation, were you running dirsync or adconnect? What happened when you re-enabled it after removing exchange?

    • Richard Voogt

      Hi Adam,

      I’ve done several migrations this way, with dirsync and with AADconnect.
      The users must be mail enabled users, before decommissioning the exchange server.
      Youre not able to re-enable the users, because Exchange is nog in the domain anymore.
      All new users,are normal users, and you need to give them an e-mail address in the AD by filling in the proxyaddress attribute

      • You don’t need to fill out the ProxyAddresses attribute. Adding the email address to the ‘Mail’ attribute is enough for AADConnect to create the user an Exchange Online mailbox.

        The only time you need to do anything with the ProxyAddresses attribute is if the user really does need a proxy address. In that case, you’ll need to populate the attribute as Exchange would have done – primary address with ‘’ and any additional ones with ‘’

  • Davide Mancini

    Hi, I am getting an error when using ExportO365UserInfo.ps1.

    The error i get is:
    The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
    + CategoryInfo : InvalidArgument: (:PSObject) [Get-Mailbox], ParameterBindingException
    + FullyQualifiedErrorId : InputObjectNotBound,Get-Mailbox

    I do get the cloud.csv, but i worry about what it is that is failing and maybe missing from the script.

    Thanks in advance

    Best regards

  • jarno

    Can this also be used with Exchange 2010?

  • Ronnie van Sinttruije

    Can this also be used with Exchange 2013?

  • Jeff T.

    Hi. I ran both PowerShell scripts on just one test user. No errors. When I enable AD Connect it syncs to Office 365, but I cannot edit the Exchange property (e.g. alias) for this user. It still says “Synced with Active Directory”. Any suggestions?

  • Jeff T.

    Thinking about this further…. This article is just for decommissioning on premise Exchange and not on premise AD and also not AD Connect. I still have to edit certain Exchange properties locally using ADSIEDIT (I know unsupported). Correct? Thanks again.

  • Praveen Sharp

    Thank you pertaining to giving this excellent content on your web-site. I discovered it on google. I may check back again if you publish extra aricles.

  • Fab

    Hi Can this also be used after Hybrid migration ?

    • Richard Voogt

      No, because then the settings online are removed!
      Use this only when you know for sure, there is no communication between the local AD an Office 365.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.