Batch file to perform an offline defrag of the Exchange db to another drive

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.

cd\
d:
cd\
cd\Program Files\Exchsrvr\bin\

eseutil /d /p "d:\program files\exchsrvr\mdbdata\priv1.edb" /t"Y:\exchdefrag\tempdfg.edb"

Leave a Reply

Your email address will not be published. Required fields are marked *