An Exchange database plays a vital role in the functioning of an organization. It stores all the critical information, including emails, contacts, and calendars. However, failure can occur for multiple reasons, such as power failure, virus and may cause the Exchange database can become corrupted, leading to data loss and other issues. In such cases, it becomes necessary to use specialized tools to recover the Exchange database.

ESEUTIL is a command-line tool provided by Microsoft for Exchange database recovery. It is designed to repair and recover corrupt Exchange databases, defragment them, and perform other maintenance tasks. In this beginner’s guide, we will walk through the steps required to recover the Exchange database using ESEUTIL.

Pre-requisites

Before attempting to recover the Exchange database using ESEUTIL, it is essential steps to consider before using the tool:

  • Take a backup: It is crucial to take a backup of the Exchange database before attempting any recovery operations. This ensures you have a copy of the database if something goes wrong during recovery.
  • Free up disk space: ESEUTIL requires free disk space to create temporary files during recovery. Ensure enough free space is available on the disk where the database is stored.
  • Database Information: we also need information related to the database, such as the Log file path, EDB path, and Checkpoint file.
  • Exchange Management Shell

By following these prerequisites, you can ensure a smooth and successful Exchange database recovery using ESEUTIL.

Finding the Dismounted Exchange Database Using PowerShell.

First, connect to the Exchange Server using Exchange Management Shell and run the Get-MailboxDatabase cmdlet. A list of all dismounted databases is returned, including the database name, server name, and state of each dismounted database.

Here’s an example PowerShell command to find dismounted Exchange databases:

PS> Get-MailboxDatabase -Status | where {$_.Mounted -eq $false}


Name         Server     Recovery        ReplicationType
----         ------     --------        ---------------
EXDB1        ExSrv01     False           None

This command uses the Get-MailboxDatabase cmdlet with the -Status parameter to list all mailbox databases on the Exchange Server.

Due to the load, the ESEUTIL can cause to the server, it’s highly recommended to place the server in maintenance mode before starting. You can place enable Exchange Server Maintenance mode easily using EMM PowerShell Module.

Collecting Information About The Corrupted Database

After identifying the dismounted and possibly corrupted database, we need to get some paths. Using the following PowerShell script to get the details for the database.

PS> $BadDB=Get-MailboxDatabase -Status EXDB1 | Select-Object LogFilePrefix,EdbFilePath,LogFolderPath

PS> $BadDB

LogFilePrefix : E03
EdbFilePath   : C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\EXDB1\EXDB1.edb
LogFolderPath : C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\EXDB1

Now we have the basic information related to the database, let’s dig deeper and find the status of the database. First, we need to read the database header using the eseutil.exe.

The Eseutil.exe is located in the Bin directory within the Exchange Server installation folder. But no need to remember the path as it can be called from any directory once you start the Exchange Management Shell.

Use the following PowerShell line to get the database header information.

PS> Eseutil /mh $BadDB.EdbFilePath

If you don’t want to use the PowerShell variables, it’s OK to use the full path to the EDB, so the command line is like the following.

Eseutil /mh "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\EXDB1\EXDB1.edb"
Dirty Shutdown
Dirty Shutdown

The State represents the status of the database if it was a Clean Shutdown, then you should be able to mount the database. But if the State was Dirty Shutdown some recovery is required.

The Log Required refers to the transaction logs required to recover an Exchange database. ESEUTIL can be used to repair and recover the database by replaying the transaction logs. However, for successful recovery, ESEUTIL needs access to all the transaction logs containing data that was not yet committed to the database at the time of the failure. The recovery process may fail if any required logs are missing, and data loss can occur.

In the case of damaged or deleted logs, the value of the Log Required could be something like 50-80 (0x32-0x50), which means that the logs E030000032 to E030000050 are required to mount the database.

The value of Log Required is as the following: Decimal range (Hex Range)

In the example I provided above, no damaged or missing logs exist, as the Log Required is 0-0. We can confirm by running the following line to ensure the correct log sequence.

PS> Set-Location $BadDB.LogFolderPath
C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\EXDB1>

PS C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\EXDB1> Eseutil /ml $BadDB.LogFilePrefix

The output is

Log check
Log check

As for now, all the logs are OK. But a soft recovery is required if the database is still in a Dirty Shutdown state and there are missing logs.

Performing Soft Recovery using ESEUTIL

Performing a soft recovery is simple. The command line structure is as the following.

Eseutil /r <LogPrefix> /l "Log Folder Path" /d "Database Folder Path"

Don’t forget you can get all these information by running the following line. This makes copy-paste easier and minimizes typo mistakes.

Get-MailboxDatabase -Status EXDB1 | Select-Object LogFilePrefix,EdbFilePath,LogFolderPath

Start by navigating to the database log folder. The full eseutil command structure to perform a soft recovery is:

PS> eseutil /r E03 /l 'C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\EXDB1' /d 'C:\Program Files\Microsoft
\Exchange Server\V15\Mailbox\EXDB1'

The process may take time. If all is fine, the operation should complete successfully. You can confirm by checking the database header State and confirming it’s in Clean Shutdown.

You should be able to mount the database at this point. But what if things did not go as expected and the database did not go up?

Performing Hard Recovery using ESEUTIL

During the hard recovery process, ESEUTIL analyzes the database files, identifies any structural or logical issues, and repairs them as necessary. While this process can help recover a corrupt database, it can also result in data loss and should be used as a last resort. It is recommended to perform a backup of the database before running a hard recovery process.

The parameter to use the hard recovery is ESEUTIL /P, followed by the full path of the EDB file with the file extension.

ESEUTIL /P <Full Path to the EDB file.edb>
ESEUTIL /P
ESEUTIL /P

After running the hard recovery completes, we need to use the New-MailboxRepairRequest cmdlet.

Using New-MailboxRepairRequest To Repair Exchange Database

The New-MailboxRepairRequest cmdlet can perform various types of repairs, such as fixing folder views, repairing search folders, and fixing corrupt messages. It can be run against individual mailboxes or against an entire mailbox database.

At this point, you need first to mount the repaired database. Type the following line in Exchange Management Shell.

PS > New-MailboxRepairRequest -Database "EXDB1" -CorruptionType ProvisionedFolder,SearchFolder,AggregateCounts,FolderView

After running the line, a new repair job is triggered in the background. You can track the progress by using the Get-MailboxRepairRequest cmdlet

Get-MailboxRepairRequest -Database "EXDB1"

The output returns a list of all the repairs performed on the database and the completion percentage.

Identity                Task                    Detect Only             Job State               Progress
--------                ----                    -----------             ---------               --------
1e108ea6-6795-498b-9... {ProvisionedFolder}     False                   Succeeded               100
1e108ea6-6795-498b-9... {SearchFolder}          False                   Succeeded               100
1e108ea6-6795-498b-9... {AggregateCounts}       False                   Succeeded               100
1e108ea6-6795-498b-9... {FolderView}            False                   Succeeded               100
1e108ea6-6795-498b-9... {ProvisionedFolder}     False                   Succeeded               100
1e108ea6-6795-498b-9... {SearchFolder}          False                   Succeeded               100
1e108ea6-6795-498b-9... {AggregateCounts}       False                   Succeeded               100
1e108ea6-6795-498b-9... {FolderView}            False                   Succeeded               100
1e108ea6-6795-498b-9... {ProvisionedFolder}     False                   Succeeded               100
1e108ea6-6795-498b-9... {SearchFolder}          False                   Succeeded               100
1e108ea6-6795-498b-9... {AggregateCounts}       False                   Succeeded               100
1e108ea6-6795-498b-9... {FolderView}            False                   Succeeded               100
1e108ea6-6795-498b-9... {ProvisionedFolder}     False                   Succeeded               100
1e108ea6-6795-498b-9... {SearchFolder}          False                   Succeeded               100
1e108ea6-6795-498b-9... {AggregateCounts}       False                   Succeeded               100
1e108ea6-6795-498b-9... {FolderView}            False                   Succeeded               100

We got the database recovered and mounted in the Exchange server for now. But sometimes, this is not enough. For example, what if the Exchange Server crashes and needs to recover some emails ASAP?

Go Easy and use Stellar Repair For Exchange.

Stellar Repair for Exchange uses advanced algorithms to scan the database and identify any issues, such as damaged pages or corrupt messages. It can also restore accidentally deleted mailboxes and mailbox items, making it a useful tool for disaster recovery scenarios. The software provides a simple and user-friendly interface and supports parallel processing, which can save time when dealing with multiple mailboxes.

You can use Stellar Repair for Exchange to recover an offline database, that is, without even having an Exchange Server. Just restore or get your EDB file and let the application do the magic. Here is how.

The application interface is so simple after installing and opening the application. You will see the following.

Stellar Repair for Exchange
Stellar Repair for Exchange

Click on Browse and select the EDB file you want to open. I run the application on my Windows 10 machine. Click on Next

Scanning Mode

Depending on the need, you can select between quick and extensive scans. As my test database size is small, I will select Extensive scan.

After the application scans the EDB File, you get a list of all the user’s mailboxes in the database.

Mailboxes in EDB

Selecting any mailbox will expand the mailbox content and the mail folders in the application.

Clicking on any folder, for example, the Inbox folder loads the inbox content.

You can recover and export a single message to multiple formats, such as MSG, EML, HTML, RTF, and PDF.

But this is not the only part I like. Here is what I really like. The ability to export an entire mailbox from the EDB as PST, MSG, EML, HTML, PDF, export the content back to the Exchange server, Export the content to Office 365, and the ability to export the Public folder.

A feature to export the content to Exchange Server and/or Office 365 is a saver as you can quickly recover emails from an offline EDB to an online system.

Stellar Repair for Exchange can also read the Calendar folder and get the meeting from the user’s calendar, so we got a full mailbox recovery, not only the main folders.

ESEUTIL VS Stellar Repair for Exchange

Stellar Repair for Exchange and ESEUTIL are two popular tools used for Exchange Server database recovery. While both tools can recover a corrupted database and restore lost data, their features and performance differ.

Stellar Repair for Exchange is a third-party software tool with a user-friendly interface and advanced algorithms to recover corrupted Exchange databases. It can recover all mailbox items, including emails, contacts, calendars, and attachments, and supports parallel processing for multiple mailboxes. Stellar Repair for Exchange can also restore accidentally deleted mailboxes and items, making it a useful tool for disaster recovery scenarios. However, it is important to note that Stellar Repair for Exchange is a paid tool requiring a license.

ESEUTIL, on the other hand, is a built-in utility that comes with Microsoft Exchange Server. It is a command-line tool used to repair and defragment Exchange databases. However, ESEUTIL has a steep learning curve and can be challenging for beginners. It also requires the database to be dismounted before running, which can result in user downtime. Also, you can not use the ESEUTIL to recover a single item from a database restored to a file and not attached to Exchange Server.

Summary

In summary, Stellar Repair for Exchange offered a more user-friendly interface and advanced to recover Exchange databases, while ESEUTIL provides reliable and fast database repair and defragmentation. Exchange administrators should consider the specific needs of their organization and the level of expertise of their IT staff when deciding between these two tools.

5/5 - (1 vote)