Convert Exchange 2003 mailboxes to mail-enabled users after a staged Exchange migration

Lou Mandich, Sr. Premier Field Engineer, Microsoft Services

Marc Nivens, Sr. Escalation Engineer, Exchange Server Support

Mark Johnson, Sr. Technical Writer, Exchange Online

Last update: 10-31-2011

If you’ve completed a staged Exchange migration to migrate your organization’s Exchange 2003 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).

We’ve provided a Visual Basic (VB) script that you can run to convert Exchange 2003 mailboxes to MEUs. When you run this script, the proxy addresses from the cloud-based mailbox are copied to the MEU, which resides in Active Directory. Also, the properties of the MEU enable the Microsoft Online Services Directory Synchronization tool (DirSync) to match the MEU with its corresponding cloud mailbox.

There’s also a Windows PowerShell script that collects information from the cloud-based mailboxes.

Best Practice: It’s recommended that you convert on-premises mailboxes to MEUs for a migration batch. After a staged Exchange migration batch is finished and you have verified that all mailboxes in the batch are successfully migrated and the initial synchronization of mailbox items to the cloud is complete, convert the mailboxes in the migration batch to MEUs.

Downloading the scripts

There are scripts to help you convert mailboxes to MEUs. Click the following links to download the scripts.

  • Exchange2003MBtoMEU.vbs   Coverts on-premises Exchange 2003 mailboxes to MEUs
  • ExportO365UserInfo.ps1   Runs in your cloud-based organization to collect information from your cloud mailboxes and saves it to a CSV file. The Exchange2003MBtoMEU.vbs script uses the information in the CSV file to bulk-create the MEUs.

What do the scripts do?

Here’s a brief description of what each script does.


This is a Windows PowerShell script that you run in your cloud based organization to collect information about the cloud mailboxes that you migrated during the staged Exchange migration. It uses a CSV file to scope the batch of users. It’s recommended that you use the same migration CSV file that you used to migrate a batch of users.

When you run the ExportO365UserInfo script:

  • The following properties are collected from the cloud mailboxes for the users listed in the input CSV file:
    • Primary SMTP address
    • Primary SMTP address of the corresponding on-premises mailbox
    • Other proxy addresses for the cloud mailbox
    • LegacyExchangeDN
  • The collected properties are saved to a CSV file named Cloud.csv


This a VB script that you run in your on-premises Exchange 2003 organization to convert mailboxes to MEUs. It uses the Cloud.csv file, which is output by the ExportO365UserInfo script.

When you run the Exchange2003MBtoMEU.vbs script, it does the following for each mailbox listed in input CSV file:

  • Collects information from the input CSV file and from the on-premises mailbox.
  • Creates a list of proxy addresses from the on-premises and cloud mailbox to add to the MEU.
  • Deletes the on-premises mailbox.
  • Creates a MEU and populates the following properties:
    • legacyExchangeDN   Value from the on-premises mailbox.
    • mail   The primary SMTP of the cloud mailbox.
    • msExchMailboxGuid   Value from the on-premises mailbox.
    • proxyAddresses   Values from both the on-premises mailbox and the cloud mailbox.
    • targetAddress    Read from the on-premises mailbox; the value is the primary SMTP of the cloud mailbox.

Important: To enable off-boarding from Office 365 to Exchange 2003, you have to replace the value of msExchMailboxGuid on the MEU with the Guid from the cloud-based mailbox. To obtain the Guids for the mailboxes in your cloud organization and save them to a CSV file, run the following PowerShell command:

Get-Mailbox | Select PrimarySmtpAddress, Guid | Export-csv -Path .\guid.csv

This command extracts the primary SMTP address and Guid for all cloud mailboxes into the guid.csv file, and then saves this file to the current directory.

Instead of using the input CSV file to convert a batch of mailboxes, you can run the Exchange2003MBtoMEU.vbs script in manual mode to convert one mailbox at a time. To do this, you will need to provide the following input parameters:

  • The distinguished name (DN)of the on-premises mailbox
  • The primary SMTP address of the cloud mailbox
  • The Exchange Legacy DN for the cloud mailbox
  • A domain controller name in your Exchange 2003 organization

 Steps to convert on-premises mailboxes to MEUs

1. Run the ExportO365UserInfo in your cloud organization. Use the CSV file for the migration batch as the input file. The script creates a CSV file named Cloud.csv.


.\ExportO365UserInfo.ps1 <CSV input file>




.\ExportO365UserInfo.ps1 .\MigrationBatch1.csv


This example assumes that the script and input CSV file are located in the same directory.


2. Copy Exchange2003MBtoMEU.vbs and Cloud.csv to the same directory in your on-premises organization.

3. In your on-premises organization, run the following command:


cscript Exchange2003MBtoMEU.vbs –c .\Cloud.csv <FQDN of on-premises domain controller>



cscript Exchange2003MBtoMEU.vbs –c .\Cloud.csv

To run the script in manual mode, enter the following command. Use spaces between each value.

cscript Exchange2003MBtoMEU.vbs “<DN of on-premises mailbox>” “<Primary SMTP of cloud mailbox>” “<ExchangeLegacyDN of cloud mailbox>” <FQDN of on-premises domain controller>



cscript Exchange2003MBtoMEU.vbs “CN=Ann Beebe,CN=Users,DC=contoso,DC=com” “” “/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=d808d014cec5411ea6de1f70cc116e7b-annb”


4. Verify that the new MEUs have been created. In Active Directory Users and Computers, do the following:

    1. Click Action > Find
    2. Click the Exchange tab
    3. Select Show only Exchange recipients, and then select Users with external email address
    4. Click Find Now

The mailboxes that were converted to MEUs are listed under Search results.

5. Use Active Directory Users and Computers, ADSI Edit, or Ldp.exe to verify that the following MEU properties are populated with the correct information.

  • legacyExchangeDN 
  • mail
  • msExchMailboxGuid*
  • proxyAddresses
  • targetAddress

*   As previously explained, the Exchange2003MBtoMEU.vbs script retains the msExchMailboxGuid value from the on-premises mailbox. To enable off-boarding from Office 365 to Exchange 2003, you have to replace the value for the msExchMailboxGuid property on the MEU with the Guid from the cloud-based mailbox.