ExMerge.exe version 3.70 and later has the ability to rename folders based on folder name mappings defined in the [Folder Name Mappings] section of the Exmerge.ini file.
Consider the following situation. You have a MAPI-based application that logs on to mailboxes to perform a certain task. A common example is an antivirus program that logs on to every mailbox. When this program logs on to newly created mailboxes, the default folders might be created in a language that is not the language of the users who access the mailbox. For example, the folders are created in German, but the users use English clients.
If you use ExMerge, you can automatically rename all of the German folder names to their English equivalent names. To automatically rename the folders:
- Create a .pst file with the English folder names (Inbox, Outbox, Deleted Items, and Sent Items). Call this file English.pst and place it in the C:\EXMERGEDATA folder (this is the default location of the DataDirectoryName, which is also a value in the Exmerge.ini file).
- Create a text file that contains the distinguished names of all the mailboxes that you want ExMerge to work on. Save this file as C:\Mailboxes.txt. A simple way to generate this file is to run ExMerge in interactive mode, select the mailboxes to be processed, and then save the current settings. This writes out the selected mailboxes to a text file. Cancel the program after saving the settings. Do not run the program in interactive mode.
- Set the following .ini file entries.
[EXMERGE]
MergeAction = 1
DestServerName = {Name of server containing the mailboxes}
FileContainingListOfMailboxes = C:\MAILBOXES.TXT
RenameFoldersBasedOnFolderMappings = 1
MapFolderNameToLocalisedName = 1
UseThisPSTFileForAllMailboxes = ENGLISH.PST
- Update the Exmerge.ini file with the following folder name mappings.
{Folder Name in Source Store} = {Folder Name in Target Store}
In this example, the mappings are as follows:
[Folder Name Mappings]
Inbox = Posteingang
Deleted Items = Geloschte Objekte
Sent Items = Gesendete Objekte
Outbox = Postausgang
- At a command prompt, run the following command:
exmerge -b -d -f c:\exmerge.ini
The command in step 5 assumes that the Exmerge.ini file is in the root of drive C. If this file is present in another location, you must specify the complete path to the Exmerge.ini file.
When it copies data from the source store (.pst file), when the program tries to copy data from a folder called Inbox, if the
MapFolderNameToLocalisedName entry is set to 1, the program checks to see if there is a folder called Posteingang in the target store. If it finds a folder called Posteingang in the target store, the program copies data into the Posteingang folder. Before it starts the copy process, the program checks to see if the
RenameFoldersBasedOnFolderMappings entry is set 1. If this entry has been set to 1, the program renames the Posteingang folder to Inbox, and then starts the copy process.
The results is that all the target folders in the mappings are renamed to the source folders. In this example, after the program has run, the mailbox folders called Posteingang, Geloschte Objekte, Gesendete Objekte, Postausgang are renamed to Inbox, Deleted Items, Sent Items, and Outbox, respectively.
If the target folder name in a mapping does not exist in the target store, the program creates a folder in the target store with the name of the folder in the source store. In this case, renaming is not required.
Unlike the normal operation of ExMerge, where the program looks for a unique .pst file for each mailbox processed, in this case, because you use the
UseThisPSTFileForAllMailboxes .ini file entry, the program uses the same .pst file for every mailbox.
NOTE: The process in this article only works when you run the program in Batch mode.
It is very important that you select the right mailboxes to be processed. These mailboxes
must have the folder names in the correct language (German, in this example). If the German folder names are not found, the program creates new folders in English, based on the folders
in the .pst file, and you will have folders in German and English.
Folder name mapping and renaming is supported only for top-level folders, such as Inbox, Outbox, Deleted Items, and so on.