Exchange Server Cookbook: For Exchange Server 2003 and Exchange 2000 Server
Recipe 5.6. Moving Mailboxes
Problem
You have mailboxes on one server and need to move them to another. Solution
Using a graphical user interface
For Exchange Server 2003:
Using a command-line interface
The -move switch allows you to specify a target location for the specified mailbox: > exchmbx -b <userDN> -move <server>:<storageGroup>:<mailboxDatabase> You specify <server> as a NetBIOS or FQDN; the <storageGroup> and <mailboxDatabase> values must match the server's names exactly. Using VBScript
' This code moves the target mailbox to the specified server. ' ------ SCRIPT CONFIGURATION ------ strServerName = "<ServerName>" ' e.g., CONT-EXBE01 strUser= "<UserName>" ' e.g., "Paul Robichaux" strDomain= "<domainPath>" ' e.g., "dc=robichaux, dc=net" strTargetName = "/CN=mdbName,CN=sgName, CN=Information Store," strServerContainer = ",CN=servers,cn=<adminGroup>," &_ "CN=administrative groups,cn=<orgName>,cn=" &_ "Microsoft Exchange,cn=Services,cn=configuration," & strDomain ' e.g., strServerContainer = ",CN=servers,cn=First Administrative Group," &_ "CN=administrative groups,cn=Robichaux and Associates,cn=" &_ "Microsoft Exchange,cn=Services,cn=configuration," & strDomain ' ------ END CONFIGURATION --------- ' get the target user object what = "LDAP://" & strServerName & "/CN=" & strUser &_ ",CN=users," & strDomain Set objUser = GetObject(what) Set objMailbox = objUser strTargetMDB = "LDAP://" + strServerName + strTargetName strTargetMDB = strTargetMDB + "CN=" & strServerName &_ strServerContainer objMailbox.MoveMailbox strTargetMDB objUser.SetInfo WScript.Echo "Mailbox for " & strUser & " moved to " & strTargetName
Discussion
The process of moving mailboxes is largely the same for Exchange 2000 and Exchange Server 2003. However, the Exchange Server 2003 version of the mailbox mover includes two welcome improvements:
Before you can move mailboxes across sites in a mixed 5.5/2000/2003 environment, there are some prerequisite steps you must fulfill:
The script for this recipe is distinguished largely by the long, ugly set of strings necessary to specify correctly which mailbox DB is to be used. It is necessary to specify the full path to the target MDB, but you don't have to specify anything about the source mailbox other than the DN of the user. See Also
MS KB 836489 (an update is required for mixed-mode site consolidation with Exchange Server 5.5) |