BAT
file to automate running ExMerge
The included BAT,
RunEXMERGE.BAT,
should be run with the source server name as an argument, i.e.,
RunEXMERGE
SERVER1.
This BAT file then calls ExMerge with an INI file name based off
of the server name specified, in the format of
ExMerge-<server>.INI.
Where
<server> should be replaced with the name of the server you are
migrating from, this value should also match the one in the script used
to build the mailbox input files, which are in the format of
<server>-MAILBOXES.txt.
First, the BAT sets a variable where the log files
should exist; this setting must match the
LogFileName
setting specified in matching INI file. Then is creates the directory
and deletes any existing log files. Last is calls ExMerge with /B
(batch mode which doesn't show the GUI wizard),
-D
(display progress screen, this should be removed when running this BAT
from a scheduled task), and finally
/F (INI
file that contains the setting ExMerge should use).
The included BAT file also calls GREP, a freeware
equivalent of the UNIX command, that can be used to parse text files.
The BAT file uses it to parse the log files for common errors and saves
these errors to a single log file. Since the log files can get long
GREP makes it much easier for finding errors that may have occurred.
@ECHO OFF
SET LOGDIR=Logs\%1\
ECHO Logs will be in
the Logs\%1 directory
MD Logs\%1
del %LOGDIR%*.log
ECHO Starting ExMerge,
it maybe a moment before the GUI comes up
Echo Calling "EXMERGE
-B -D -F ExMerge-%1.ini"
EXMERGE -B -D -F
ExMerge-%1.ini
Download the Code
Putting it all together
Using the included files you can either automate
the process of saving mailbox data to a PST file nightly or the process
of migrating mailbox data from one Exchange server to another.
To carry out nightly "backups" of key mailboxes you
can start by placing all of the users in a group, which the included
script supports as a source of mailboxes. To limit the backup to a
selected number of days, have a scheduled task call a BAT file that will
run the included
Update-INI-Dates.vbs
script before calling ExMerge. Using this procedure you will be able to recover the last seven
days of data, by default, from any mailboxes ExMerge has been run
against. If you choose to save all mailbox data to PSTs, you need to
keep in mind that PSTs are limited to 2 GB in size and you will need
enough hard drive space to store all of the PSTs generated.
If you plan to use ExMerge to migrate data I highly
suggest you read the Microsoft documentation on ExMerge before
beginning. The included
BuildExList.vbs and
RunEXMERGE.BAT
scripts and this article should allow you to easily schedule your
mailbox migrations and run them with less risk of user error. You can
also use the methods outlined here to reduce the size of mailboxes by
archiving old messages to PSTs. This will make it easier to manage your
current Exchange environment and plan for your migration to Exchange
2000.
The included scripts will need to be modified to
run with no user intervention and should be tested thoroughly.
Conclusion
ExMerge is a very powerful tool that can migrate
mailbox data, archive data to PSTs, remove old messages, and more. Most
importantly, it will help you reduce the administration and management
cost of Exchange by providing you with a quick way to recover data from
individual mailboxes and reduce your Exchange backup and recovery
windows, which means less downtime and end user interruptions.
|