Linuxkids Rotating Header Image

exchangeDefrag.bat

@echo off
rem ----------------------------------------------------------------------------------
rem Author:            Andrew Blokzyl
rem Contact:           drew@linuxkids.com
rem Description:       Exchange database defrag script (offline)
rem ----------------------------------------------------------------------------------

cls

echo STOPPING ALL EXCHANGE SERVICES
net stop "Microsoft Exchange Information store" /y
net stop "Microsoft Exchange Management" /y
net stop "Microsoft Exchange MTA Stacks" /y
net stop "Microsoft Exchange Routing Engine" /y
net stop "Microsoft Exchange System Attendant" /y

d:
cd safe

echo PERFORMING OFFLINE DEFRAGMENTATION
"d:\program files\exchsrvr\bin\eseutil" /d "d:\program files\exchsrvr\mdbdata\priv1.edb"

@echo RESTARTING ALL EXCHANGE SERVICES
net start "Microsoft Exchange Information store"
net start "Microsoft Exchange Management"
net start "Microsoft Exchange MTA Stacks"
net start "Microsoft Exchange Routing Engine"
net start "Microsoft Exchange System Attendant"

echo REMOVING TEMPORARY FILES
del "d:\safe\*.edb"
del "d:\safe\*.stm"

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>