Eseutil some feel comfortable with this tool others don't; Eseutil should not be taken lightly, some modes of Eseutil that can reak havock if not used in the correct situation or with the correct procedure, which is why I am outlining some simple rules and steps, so that you can use Eseutil without fear and know exactly how it use it in a certain situation.
Eseutil is used in the majority of situations when you experience issues with your Exchange Information Store not starting or misbehaving but there are some senarios were this migh not be the case as you will see in the first example of the switch Eseutil /d below:
Firstly let's look at the what this tool does, Eseutil.exe can be used to analyze/verify and then modify/repair your exchange Information Store database files, these files in a default setup are named priv1.edb priv1.stm pub1.edb pub1.stm. It should be noted now with the release of Exchange 2007 (only with the Exchange 2007 version of the tool) eseutil can be used to perform these tasks against the ESE database files on the Exchange 2007 Edge Transport and Hub Transport servers along with the mailbox and public folder stores.
So now that you know what eseutil does I am now going to outline the switches that Eseutil uses and then give an overview of the defragment mode (eseutil /d), I will save the rest of the switches for another article.
Eseutil
Defragment /d <database name> [options]
Recovery /r <logfile base name> [options]
Integrity /g <Database name> [options]
Checksum /k <file name> [options]
Repair /p <database name> [options]
File Dump /m[mode-modifier] <filename>
Copy File /y <Source file> [options]
Restore /c [mode-modifier] <path name> [options]
So as you can see there are a few commands/modes to this tool; before using Eseutil I along with Microsoft recommend follow these simple rules and you cannot go wrong:
- When using Eseutil the information store must be offline
- You can only run eseutil on one ESE database at a time
- If using Eseutil on a production database you should first make a copy of any files that you might touch, this includes all .edb .stm as well as transaction log files .log and .chk, put these aside and don't touch them unless you need to get back to the original state, and in this case copy the backup files don't move, so you always have this safety net.
- If you have a test lap virtual or physical use it, practice and write down each of the steps before performing on a production system.
Eseutil /d Defragment (Offline Defragmentation)
This switch is equivalent to your disk defragment, but a little different, what eseutil /d does is removes empty pages in the database file and rebuilds its indices. This procedure is commonly known as the offline defragmentation because the information store database is offline when the defragmentation occurs, as opposed to the regular nightly online defragmentation (maintenance) that occurs when the information store is online.
The additional options for Eseutil /d are as follows:
Note None of these additional options are required
/s<file> - set streaming file name (default: NONE)
/t<db> - set temp. database name (default: TEMPDFRG*.EDB)
/f<file> - set temp. streaming file name (default: TEMPDFRG*.STM)
/i - do not defragment streaming file
/p - preserve temporary database (ie. don't instate)
/b<db> - make backup copy under the specified name
/8 - set 8k database page size (default: auto-detect)
/o - suppress logo
In general the eseutil.exe /d is used with the default options as below:
eseutil.exe /d "C:\Program Files\Exchsrvr\MDBDATA\priv1.edb" /s "C:\Program Files\Exchsrvr\MDBDATA\priv1.stm"

Figure 1: Running the eseutil /d command
Unless you wanted the temp database created in a different location, with a different name or did not want the original database to be overwritten by the defragmented version of the database.
In general you would not use the eseutil /d switch unless, you have removed/moved a lot of mailboxes from an Exchange database file or there are -1018 errors in your event logs, or you have just performed an Eseutil /p or there has recently been a mail storm.
Personally if I have say moved X% of the mailbox from one database to another database or server, or deleted a significant amount of mailboxes I prefer defragment using the mailbox move method. All you need to do this create a new blank database and move the mailboxes to the new Information store, this has the advantage of giving you a free defragmented database, and users are not impacted as much, because you are moving a single mailbox at a time and only that user is impacted during the mailbox move process, whereas with an offline defragmentation, all mailboxes on that information store are offline until, the entire Eseutil /d process completes.
To see how much free space you have in an Exchange Database file/s just check in the event logs and look for recent occurrences of event 1221 or you can run eseutil /ms (with database offline)
When you run eseutil /d you should ensure you have at least 110% of the database files size available in free disk space on volume that the defragmented copy of the database file is being created.
Microsoft does not recommend running Eseutil /d as a regular maintenance practice, as the online maintenance takes care of this. In addition if your Exchange database is not in a consistent state you should not use eseutil /d.
In the next few days I will outline and give tips on each of the other switches or modes of Eseutil.
How did you like this article? Please add any comments or suggestions, I am always willing to answer any questions and love feedback, you might have a great idea that can be added.
Just a quick addition: I have posted the following addition/follow up to this article, please see them here:
Eseutil /P – A Quick and Easy Tutorial Eseutil /R (Soft Recovery) – A Quick and Simple Tutorial