Home » Blog » Tech Query » Defrag an Exchange Server 2016/13/10 Mailbox Database

Defrag an Exchange Server 2016/13/10 Mailbox Database

Kerry Morris ~ Modified: August 9th, 2016 ~ Tech Query ~ 4 Minutes Reading


De-fragmentation always came into picture, whenever we talk about maintenance of file systems. Because it is a process that reduces the amount of fragmented or scattered data. Fragmentation is nothing but a state of breaking or storing of a file in separate areas of memory scattered throughout the hard disk.
The process of De-fragmentation is physically organizing the data of bulk storage devices where data is stored in small fragments as scattered format. Exchange Server run the de-fragmentation process once a day by default for eliminating unused storage space. This process rearranges mailbox store and public folder store data more efficiently and defrag an Exchange 2010 mailbox easily.

Online De-fragmentation

Online de-fragmentation detects additional available database space and remove database objects that are no longer being used. Therefore like this without changing file size the process of de-fragmentation increases storage space.

Offline De-fragmentation

Offline de-fragmentation provides additional space, but in cases where you want to reduce the physical size of the exchange database you must de-fragment the Exchange. When mailbox store and public folder stores are offline then use ESEUTIL command utility to perform offline de-fragmentation of Exchange database.

Note-> ESEUTIL is an Exchange utility that is being used to de-fragment, repair, and maintain the integrity of Exchange database.


I recently migrated many users from one Exchange Server to another but the size of Exchange database is still same. I also performed online de-fragmentation but it could not completed successfully.”

In this case you must perform Offline de-fragmentation because it reduces the size of the Exchange database by discarding unused database pages and rearrange the data in Exchange database. The following two commands can executed in Exchange Management Shell (EMS):

1) eseutil /d -> This command creates new database by copying the old database records to the new one and discard unused pages. It creates a newly organized compact file.

2) eseutil /d Database_Name -> use this command in order to run eseutil de-fragmentation on specific domain. Here Database_Name is the name of the database which you want to compact.

Need to defragmentation the Exchange Server 2016/13/10 Mailbox Database

I am having trouble in managing my data because Exchange Server 2013 databases grows in size and never shrink when data is deleted from it. I have 20GB size of mailbox database and migrated 4GB of mailboxes to another Exchange Server but still the file remain at 20GB in size. Therefore in this situation we need to defragmentation the database.

Determining Free Space In Exchange 2013 Mailbox Database

By running the following eseutil command as shown in the image, you can check the available white space in your Exchange 2010/13/16 database:

1. Open the Exchange Management Shell and navigate to the folder containing the database file.


Here I see that MB-HO-01 has 18.26 GB space but 9.544 GB white space which has occurred due to archiving, and to reclaim this space the file can be shrunk by using eseutil commands of defragmentation

Eseutil to Defrag an Exchange 2010 Mailbox database

1. Open the Exchange Management Shell and navigate to the folder containing the database file.


2. Then dismount the mailbox database. See the image for reference.


3. Now run the ESEUTIL commands to defragmentation the file.


4. Then Mount the database again. Refer below image for this step.


5. Here I see that the file is smaller and all the white spaces are gone.


Note-> After the complete execution of ESEutil commands, Take full backup of the database.


This blog is written just to help users with live situations when they want to defrag Exchange 2016/2013/2010 databases. Also discussed online and offline defragmentation, why it is needed and how it can be used to remove the white spaces. Use eseutil to defrag Exchange Server and see available white spaces. Atlast we discussed the stepwise procedure to defrag an Exchange 2010 mailbox databases.