We're no longer updating this content regularly. Check the Microsoft Product Lifecycle for information about how this product, service, technology, or API is supported.
This topic provides an example of how you might use the Lightweight Directory Access Protocol Data Interchange Format directory export tool (LDIFDE) to re-home all mailbox accounts on one server to a different server.
The following table provides values related to the example. All of these values are in a single unbroken line, although they may appear wrapped on your display.
Values of attributes used in example of re-homing mailbox values
Attribute
Value
Active Directory® directory service domain name where all user accounts are located
This example assumes that you are generally familiar with Active Directory object naming and hierarchical organization and with general LDAP object and attribute naming conventions.
Procedure
To re-home mailbox accounts from Exchange1 to Exchange2
Export the user accounts with this LDIFDE command:
LDIFDE –F [output file] –D [domain and/or container name] –L [attributes to export] –R [LDAP query filter for the database]
This command exports all the user accounts linked to mailboxes in DB1, with each export record appearing similar to this one:
Note
In the examples below, several lines are formatted with an attribute name on one line followed by value names that are indented a single space and split into multiple lines. This is the LDIF convention for continuing an attribute value across a line break.
If you have a text editor that can perform a search and replace across line breaks, it is relatively easy to transform the export file into the appropriate import format. For example, you can do this in Microsoft Office® Word, where ^p is the Word search, and replace code for a line break:
Search for
Replace with
dn:
-^pdn:
changetype: add
changetype: modify
homeMTA
replace: homeMTA^phomeMTA
homeMDB
-^preplace: homeMDB^phomeMDB
msExchHomeServerName
-^preplace: msExchHomeServerName
[name of original database]
[name of new database]
[name of original storage group]
[name of new storage group]
[name of original server]
[name of new server]
After you have finished the replacements, remove the blank line and “-‘ from the top of the file before the first record, and add a “-“ and a blank line to the end of the last record.
If you are using Microsoft Word or another rich text editor, be sure to save the file as plain text. You should save the file under a new name, such as EXCHANGE2-IMPORT.TXT, so that the original export file is preserved if additional editing is required.
Import the file with this command:
LDIFDE –I – F <import file>
For example:
LDIFDE –I –F EXCHANGE2-IMPORT.TXT
Important
Do not re-home mailboxes for SMTP connectors, the System Attendant, or the System Mailbox. Remove the LDIF records for these mailbox types in your import file before you import again. Search for “SMTP”, “SystemMailbox”, and “System Attendant” to locate these mailboxes.