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

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.

ExportO365UserInfo.ps1

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

Exchange2003MBtoMEU.vbs

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>

 

Example:

 

.\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>

 

Example:

cscript Exchange2003MBtoMEU.vbs –c .\Cloud.csv DC1.contoso.com

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>

 

Example:

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

 

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.

0 out of 1 people found this post helpful.

Sort by: Published Date | Most Recent | Most Useful
Comments
  • Running theExchange2003MBtoMEU gives an error on deleting mailbox:

    Error 438 - Object doesn't support this property or method

  • re:  Error 438

    This script needs to be ran on the Exchange server or a workstation with the Exchange Management tool installed.

  • Hi

    I would like to know if I still need to run this after a staged migration, I know this article is from 2011, and I saw some articles that says that the batch process was doing that automatically.

    When I try to run it in the Exchange Server 2003 (that server is also a DC and GC - not my choice BTW is a customer), I get "No users found for address joe@contoso.onmicrosoft.com"

    thank you

  • Every time I try running the VBS script it gives me "Expected 'Next'" line 343, Character 43.  I have downloaded the script multiple times, thinking that it had gotten corrupt, but every time it gives the same error.  I know this post has been out here a long time, has the file gotten corrupted?  Any ideas?

  • Nathan, look up the script file by name and download the complete version elsewhere.  The version uploaded here is cut off by about 2KB.

  • We have uploaded the complete script in a zipped file, which resolves the truncation issue. We're looking into cause of truncation.

    community.office365.com/.../14672.aspx

  • It seams like the script has issues with a "," in the ExchangeLegacyDN. More Details in the Forum: community.office365.com/.../438591.aspx

  • Hi

    I've followed everything in the guide. The script has run successfully. When I go into Exchange System Manager, the mail box I migrated is still listed, is this right? Should it be fully removed?

    When I try create a new profile linked to the migrated account its not auto discovering the settings.

    Could you please help me further.

    Thanks,

    Justin

  • hi,

    when I am doing this step

    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>

    Example:

    .\ExportO365UserInfo.ps1 .\MigrationBatch1.csv

    there are some errors as below

    The operation couldn't be performed because object 'raohuanhuan@dpa-cn.com ' couldn't be found on 'HKXPRD0610DC002.apcprd06.prod.outlook.com'.

    I have confirmed that the user have mailbox on exchange online and have the correct lisence

    Pease help

  • This process failed at the delete mailbox step. Likely because I wasn't running the VBS script on the Exchange server or a server running the tools.

    So I need to manually create the MEU for a few users. Can someone please tell me how to add this information into AD manually? I can delete the old mailbox manually and run the wizard to create a mail enabled user, but I'm sure I need to place more information into AD for this user (GUID?) to get Outlook to auto configure. Any help is GREATLY appreciated.

  • Hi,

    We have ran the two scripts. No issues detected during the execution of the scripts. The mailboxes of the converted users get marked deleted in the Exchange System Manager 2003. But when we try to purge the mailbox we receive this error message 'The operation cannot be performed because this mailbox was already reconnected to an existing user. ID no: c1034qd6 - Exchange System Manager. Any help is welcome! Best Regards Bart

Page 1 of 1 (11 items)