Automating Exmerge 2003 and Exmerge 2000

First need to download Exmerge.exe from the below mentioned link and extract the files to c:\Program Files\Exchsrvr\bin of Exchagne 2003 Machine

http://www.microsoft.com/downloads/details.aspx?familyid=429163ec-dcdf-47dc-96da-1c12d67327d5&displaylang=en

  • *************************************************************************

Then you need to list of list of users you wanted to exmerge at a time. Use the below given VBscript to get the legacyDN name for the list of users given the text file as input.  It creates a file called Legacyaddresses.txt

Dim filesys,filetxt
const ForReading = 1, ForWriting = 2, ForAppending = 8
InputFile = Inputbox(“Enter Path of the txt file”)
InputFile = trim (InputFile)
if InputFile = “” then
wscript.echo “You did not enter the user name. Script Quits!! ”
wscript.quit(0)
end if

set objShell = Createobject(“Wscript.Shell”)
drivepath = objShell.CurrentDirectory
set rootDSE = GetObject(“LDAP://RootDSE“)
DomainContainer = rootDSE.Get(“defaultNamingContext”)

set conn = CreateObject(“ADODB.Connection”)
conn.provider = “ADSDSOObject”
conn.Open “ADs Provider”

Set filesys = CreateObject(“Scripting.FileSystemObject”)
set filetxt1 = filesys.OpenTextFile(InputFile,ForReading)

fulname = drivepath & “\” & “Legacyaddresses.txt”
set filetxt = filesys.OpenTextFile(fulname,ForAppending,True)

do Until filetxt1.AtEndOfStream
 name = filetxt1.Readline
 name = trim(name)
 strLDAP=”<LDAP://” & DomainContainer &”>;(&(mailnickname=”& name &”)(objectCategory=person)(objectclass=user));adspath;subtree”
 set ocomm = createObject(“ADODB.Command”)
 ocomm.ActiveConnection = conn
 ocomm.CommandText = strLDAP
 set rs = ocomm.Execute
 if rs.EOF then
  wscript.Echo name & ” did not found!”
 
 else
  set FoundObject = GetObject(rs.Fields(0).Value)
  filetxt.Writeline(Foundobject.legacyExchangeDN)
 
 end if
loop

                                        ****************************************************************************

You Extracted 2  files Exmerge.exe , ExMerge.ini c:\Program Files\Exchsrvr\bin. 

Exmerge.ini contatin detail descrition on export and import from and to PST of the mailbox. Find the below mentioned lines the Exmerge.ini and edit as given below

1. MergeAction = Set value to 0

2. SourceServerName = Give any one server name in the Exchange Administrative group

3. DataDirectoryName = Give the path details where you wanted to export the pst (Ex. D:\ExmergeData)

4. FileContainingListOfMailboxes = Give the  path of the Txt file which has list of legacyDN addres of the users which u exported from the above script (Eg. D:\ExmegeData\Mailboxes.txt)

5. Go command prompt and type c:\Program Files\Exchsrvr\bin\exmerge.exe  -F c:\Program Files\Exchsrvr\bin\exmerge.ini -B -D

6. This will Export all the mailbox specified in list to PST to the given location which is mentinoed in DataDirectoryName, You can add the above line in the batch file and schedule it. Need to make sure that you have sufficient rights on the mailbox for the export.

7. Limit the mailbox you export at a time, depending on the performance of the machine. You can limit the mailbox export by limiting the number of mailboxes in mailboxes.txt which is refered by  FileContainingListOfMailboxes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s