• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 939
  • Last Modified:

Exmerge automation

 We are using Exchange 2000 for our students and at the end of the school year, we are making a .PST of their mailboxes for them to take with them. We are using Exmerge but we are doing each mailbox one by one. Is there a way to write a batch or scrit file for this? I've seen some answers on  here but they did't go into a lot of detail.
 We are using BackupExec to backup the mailboxes normally, this is for creating .PST files for our students when they leave.

  • 2
1 Solution
It all how you set up the exmerge.ini file - either through the Wizard or editing by hand. You can have Exmerge automatically export every mailbox you have to PST files. Once you set that up, you can run it as often as you like and it will export every mailbox.

It is also possible to set up a text file that has a list of the mailboxes that you wish to extract. This may solve your problem by changing that text file as needed and then running exmerge.

I have Exchange 2003, so the exact steps may not be exactly the same, but they should be close.

The first step is to set up the wizard to export ALL the mailboxes, Once you have that, we can add the file that will limit the extracts as needed.

1. Run exmerge from explorer, not the command prompt.
2. The first real question is about a one step or two step procedure. We want a two-step procedure.
3. We want to do Extract the information, which is Step 1 of the two step process. We will never get to Step 2 (importing) in this scenario.
4. You will be asked for your mail server name. Pretty straight forward. No slashes or anything.
5. It should search for the mailboxes at this point. It may take a bit of time if you have a large number of mailboxes.
6. Select All
7. Default locale - whatever shows up should work. Should match your country / launguage.
8. Target Directory - put it somewhere local to the exchange server, if you can afford the space.
It will save you lots of time in comparison to creating the files over the network. I create the EXMERGE files every day locally and then copy them to my backup server for storage. Saves hours of network time a day.
9. SAVE THE SETTINGS. if you don't you'll have to do this wizard again the next time.
10. When you hit the NEXT button, it will start extracting. You can let it go or stop it, if you want to script the mailboxes one-by-one.

That's the Wizard / basic setup. Now for setting up the file with the names in it:
1. Find and edit exmerge.ini. There may be a few running around. The one you want has the date and time of the moment that your clicked on Save Setting in the previous section. Notice the location of the file. You are going to need that.

2. Look for this section:

; FileContainingListOfMailboxes
; Name of a text file containing the Exchange Distinguished Names (DN) of mailboxes to be
; worked on. Each line of the file should have the following format:
; <SourceDN> [<DelimiterUsedInMailboxFile> <TargetDN>]
; The TargetDN is optional. If it is specified, depending on what the selected merge action
; is, it will be used to get the name of the PST file to be generated, or the name of the
; mailbox into which data will be merged.
; By default, a comma is used as the delimiter between the source and target DNs. You
; can specify another delimiter, using the DelimiterUsedInMailboxFile setting.
; Blank lines are ignored.
; Lines beginning with a ##~ are ignored as comments
; If this setting is not specified, all mailboxes, except those for services (DS, IMS etc)
; on the specified server will be processed.
; This setting is only applicable when running the program in Batch mode.
; Default Value: Blank
FileContainingListOfMailboxes =

3. Add the name of the file that you are going to use (including full path) for your student names after the equal sign like  FileContainingListOfMailboxes =c:\exnames.txt
 You may be better off keeping it under the old 8.3 rules for the file name. It's just easier.

4. Save the .ini file.

5. Edit the exnames.txt (or whatever) file and add the names of the mailboxes, one per line. This is not usernames, but the exchange names that are usually in all caps.

6. Run exmerge from a batch file  similar to the following:
@Echo off
erase d:\exmerg~1\*.pst
Echo Starting Exchange Export of mailboxes (ExMerge.exe)...
c:\progra~1\exchsrvr\bin\exmerge.exe -b -f: c:\progra~1\exchsrvr\bin\exmerge.ini -logmin
echo Done!

You will have to change your locations as needed
The first erase line is pretty important. That gets rid of your old junk and prevents exmerge from trying to append to an exisiting PST rather than creating a new one.
The exmerge line needs the full location of exmerge.exe and of the exmerge.ini file.

Now the only thing you have to do is run step 5 and 6 as often as needed!

At the end of the sememster, you may wish to take the c:\exnames.txt reference out of the ini file and make a PST for everyone.

logisoftoperationsAuthor Commented:
Thanks! That's exactlly what I needed to know.

One other question regarding the mailbox text file. Is there an easy way to generate a list of exchange users? I was able to export the AD list using LDAP, but I don't see the exchange account name listed there. Also, how would the final file look line by line? Thanks again.
logisoftoperationsAuthor Commented:
Never mind. I figured out the export. Hopefully I should be all set. Thanks for all the help
Hi logisoftoperations

This is a very useful article . I was hoping you could tell me how you were able to generate the list of users.. ?


Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now