Subscribe to our Newsletter. The latest news and articles delivered to your Inbox!
A Software Development Consultant with over 20 years of experience. Many of his projects involved Exchange integrated applications, including a FAX server, a mail security product and anti-spam products.
The command-line is the right interface to take full advantage of ExMerge. Here we combine it with ldifde.exe and exmergeini.exe to configure mailbox processing and facilitate batch process integration.
In Windows 200x systems you can extract these values from Active Directory. Specifically each user account object (linked to an Exchange mailbox) will have the property legacyExchangeDN holding the required value. You could use adsiedit (included with the Windows 200x support tools), to read this for individual users.
Another option is the ldifde.exe command-line tool. This application is installed on Windows 200x servers. It is very useful when importing/exporting objects from Active Directory. Here I will just show an example of how ldifde.exe could be used for this purpose.
ldifde.exe -v -f c:\temp\users.txt -r "(& (objectclass=user)(mailnickname=*))" -l legacyExchangeDN -d CN=users,DC=domain,DC=com
The above command processes user objects under CN=users,DC=domain,DC=com. The exported objects are required to match the condition (& (objectclass=user)(mailnickname=*)). This filter is meant to only include users having an Exchange mailbox. The amount of information exported for each user is kept to a minimum through the -l legacyExchangeDN parameter sequence. Finally the exported data is saved to c:\temp\users.txt.
Here is how users.txt looks like:
Another aspect of ExMerge that can pose a little challenge is the setting of INI file values on the fly. Let's say ExMerge is part of a batch process performing a brick level backup. The generated pst files are to be saved in a directory whose name is constructed based on the date.
Using the configuration INI file this can be done by setting the DataDirectoryName value. However editing INI file values automatically is not that simple. For this purpose, I built a little application ExMergeIni.exe to do just that. Get your copy from the downloads section. For those having some programming background, this application boils down to calling the Win32 WritePrivateProfileString function.
With this application you can set any of the INI file values. Here is an example:
ExMergeIni.exe DataDirectoryName c:\ExMerge\Brick -f c:\ExMerge\Config.ini
The first parameter identifies the configuration setting name whereas the second identifies its value. The optional -f switch allows for specifying the path to the INI configuration file. For complete details on how to use the application just run it with no parameters.
Finally here is a little batch file example showing ExMergeIni.exe and ExMerge.exe in use together. This batch file takes one parameter specifying the path where the exported mailboxes and log files are to be saved. The script does include some hard-coded paths, but this is just for illustration purposes.
echo = Backup Script =
echo - Base Backup Destination Path: %1
if NOT EXIST %1 ( echo - FAILED: Invalid destination path.
goto end )
C:\Backups\Script\ExMergeIni.exe DataDirectoryName %1\Exchange\Brick
C:\Backups\Script\ExMergeIni.exe LogFileName %1\Exchange\logs\ExMerge.log
"C:\Program Files\Exchsrvr\bin\ExMerge.exe" -b -f C:\Backups\Script\ExMerge.ini
Arguably the most useful interface exposed by ExMerge is the command-line. Through ldifde.exe, mailbox DNs may be retrieved to populate its list of mailboxes. ExMergeIni.exe facilitates batch processing, allowing the automatic adjustment of INI settings as necessary.
Meeting the ExMerge Requirements
ExMerge Download - Tools for Exchange Server 2003