One of the tools that Microsoft has provided to the community for Office 365 migrations is the Exchange2007MBtoMEU.ps1 PowerShell script.

If you’ve completed a staged Exchange migration to migrate your organization’s Exchange 2007 on-premises mailboxes to Office 365 and you want to manage cloud-based users from your on-premises organization—using Active Directory—you should convert the on-premises mailboxes to mail-enabled users (MEUs).

While using the script on a project I considered that it would be helpful if the script logged the changes that it made when it was converting the mailbox users to mail-enabled users.

With Microsoft’s permission I am publishing my modified version of the script. It functions the same way as the original, so you should follow Microsoft’s guidance here.

The only significant difference is the log file that is produced by my version of the script. It is simply written to the same folder where the script is running from, and basically contains the same information that the script outputs to the console while it is running.


Download Ex2007MBtoMEU.ps1-Customized from Github.

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for


  1. Niels

    I am getting an error when using ExportO365UserInfo.ps1.
    I am unsure if the error is caused by a problem on the server, or if Microsoft has changed something in O365.

    I do get the cloud.csv, but i worry about what it is that is failing and maybe missing from the script.
    I tested both scripts with one user, and the user is perfectly converted to a MEU.

    Should i worry about the error, or just close my eyes and convert the whole company?

    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

    Thanks in advance.
    Best regards

    1. Davide Mancini

      Hi Niel,
      I have the same problem in our company and i haven’t tested 2° script yet (exchange2007 one). Have you solved the issue?

      Thanks in advance

  2. Svetoslav

    The interesting thing is that MS stated the script copies the LegacyExchangeDN from the mailbox to MEU and actually there is no such code inside

Leave a Reply