Just sticking this here as a placeholder for myself. I’ve had the occasion to need to do offline defrags of the Exchange private store onto a different drive due to the drive where the private store having too little space. Microsoft has some great documentation on using the eseutil, but their scenarios don’t include scripts for automating or scheduling after hours offline defrags.
As I have to perform additional offline defrags, I’ll post more scripts that have been tested to work so you can simply drop the script in a directory and schedule it to run with the operating system.
* Batch file for performing an offline defrag to another drive letter. The private store is installed on the D: drive and is being pushed to the Y: drive in the exchdefrag directory.
eseutil /d /p "d:\program files\exchsrvr\mdbdata\priv1.edb" /t"Y:\exchdefrag\tempdfg.edb"