Tuesday, 31 January 2017

How to use ESEUTIL utility different switches

Sometimes administrators are faced Exchange server failure issue due to temporary power cut-off or due to something serious Exchange Server issue. No matter what is the reason, when you manage to get the server up again, it may come out that the .edb file has troubles to mount and shows the status called Dirty Shutdown Error. In these scenarios, ESEUTIL will help a lot to fix these issues. ESEUTIL used to fix corrupted Exchange databases, defragment Exchange database, reduce database size & check Exchange Database integrity.
Before using ESEUTIL tool, please make sure following steps:

1.    First Check the Application Log detailed events for the startup of Exchange database. Open any error events and use the Microsoft Knowledge Base ( to look up error numbers listed in the description fields.
2.    Try to restart the server. This is the Best way of clearing out random problems in Exchange Server and getting you back your database in the clean state when you don’t have time to find the root cause of the problem.

The ESEUTIL tool: the ESEUTIL tool has many switches:
PS: Before using ESEUTIL tool, first make sure that you have updated the backup copy of database files.

•    ESEUTIL /D – defragment the database files
•    ESEUTIL /R – restore your database
•    ESEUTIL /G – check database integrity
•    ESEUTIL /K – verify checksums in the database
•    ESEUTIL /P – repair corrupt databases
•    ESEUTIL /M – display database files’ headers, logs or checkpoint files
•    ESEUTIL /Y – copy database files and log files in a more efficient way
•    ESEUTIL /C – perform hard recovery of a database

Defragment the database files:

First thing when you are going to perform defragging database file the database should be dismounted (Offline mode) so that user’s database will not be able to access their email during the defragging process.

The second thing, you need some free space to perform the defragging.  (Free disk space equal to 110 percent of the end size of the database)

Generally, defragmentation is not recommended because it only removes white space in the database that later will be filled in with data anyway. So Many Exchange administrators asked for Should We Defrag Exchange Server Mailbox Databases? The Answer is it depends on some reasons: Take a look at Reasons to Defrag Mailbox Databases

•    If there is no additional space available to create a new database for mailboxes migration
•    If you get active alerts for low free space on the storage for the database
Steps to Defragment the database files:

•    First start with is to dismount the database: Dismount-Database –Identity <database_name>
•    Run the ESEUTIL tool and /d switch: Eseutil /d <database_name> [options]
•    Mount the database again: Mount-Database –Identity <database_name>

Let’s check how much free space is taken up by the database now. To verify that you can use this cmdlet: Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace

Repair your Database with ESEUTIL

If Exchange database has been reported in Dirty Shutdown state. If you will check the error, there is the Log required header which informs about the necessary log files.

The missing log files are required to recover the database without any data loss. If this is the case, you can use following command:
ESEUTIL /r <log_prefix> /l <path_to_the_folder_with_log_files> /d <path_to_the_folder_with_the_database>

After this cmdlet being executed, the missing logs will be restored to the database.
Now, check the state of our database one more time, it will show in Clean Shutdown State.
The database can be mounted now. Use this cmdlet to complete the task:
Mount-MailboxDatabase –identity <database_name>

Hard Recovery using Eseutil

Hard Recovery using Eseutil may cause data loss and make it difficult to predict how much data may be lost. This is the reason why the hard recovery should be used only as the last resort when there is no other alternative to recover the Exchange database. In this case, you can use Third Party Exchange Recovery Software. By using these tools, you have the assurance of no data loss.

The process of hard recovery has three stages:

•    Exchange Database repair with ESEUTIL /P switch.
•    Defragmentation of the Exchange database and its reconstruction with the /D switch.
•    Index repair within the database with the IsInteg tool.

Let’s start with hard recovery:

ESEUTIL /P <path_to_the_database>
Then, you need to defragment the database as discussed above.
The final stage is to use the IsInteg tool to repair the database. It repairs mailboxes as well as folders.

To repair the Exchange database, execute the following command:
Isinteg –s <server_name> -fix –test alltests

At the end of an Isinteg fix run, you will check that there are thousands of warnings listed. You don’t need to worry about it. The thing that you need to worry about is not warnings, but errors. After successful completion of Isinteg command, there should be zero errors reported. If there are one or more errors, then you should run Isinteg again & again until you get the error count down to zero. Once the repair has been finished, you are ready to mount the Exchange database.

If still, Isinteg does not decrease the number of errors reported, then you should restore your database from updated backup. One another solution is to use Third Party Exchange Recovery Software. By using these tools, you can recover Exchange database without backup.


If your Exchange database is damaged, data can be restored from backup or repaired using Eseutil and Isinteg. Always make a backup of your Exchange database and keep in mind that Eseutil and Isinteg utilities cannot guarantee 100% success rate. 


Post a Comment