1. Do you need to do a defrag? First establish how much whitespace there is in your Exchange databases by running the following in Exchange Management Shell.
Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto
3. Disable any reboots of the Exchange Server or Domain Controllers if they are going to clash with the work.
4. You will need 110% of the largest database size as free space, either on the same server or elsewhere on the network. In my case, as it was a virtual server I shutdown the VM and added a new VHD. I then powered back on and assigned this VHD a drive letter.
5. Stop the Microsoft Exchange Information Store service.
6. Open command prompt and run
eseutil /d "f:\Program Files\Microsoft\Exchange Server\V14\Mailbox\DB01\DB01.edb" /t "g:\DB01temp.edb"
(The first path points to the Exchange database - edb file - that you wish to run the eseutil /d against, the other path is the the temp location used for the defragmentation process)
This can take a few hours. The command window will keep you updated of the progress, which is in two stages - the defragmentation and then the moving of the new edb file from the temp to the original location.
7. When the eseutil /d command has been run against all databases you can now restart the Microsoft Exchange Information Store service.
8. In the Exchange Management Console, check all databases have mounted. Check you can send and receive internal and external email.
9. In my case, I then shutdown the VM and removed the temp VHD from Hyper-V Manager. (I also deleted this VHD to reclaim space on the Cluster Storage Volume)..
10. Power on the server. Final test of inbound and outbound email.
11. Re-enable any server reboots you disabled earlier.
12. Run Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto in Exchange Management Shell and see your databases are now much smaller from when you started.