This is my first blog post (ever) and i hope to share my experiences out in the world of IT with you.
I am a firm believer that information on how to make our lives as IT support easier should be shared with other IT Pros out there. Kinda a big happy family idea really.
Anyway, here is my first blog/post on "A quick way to reboot a server with Exchange and AD installed"
---The background Story---
One of my first experiences with a server sitting at the "Windows is shutting down" screen for a long time just so happened to be one of my first experiences of restarting a server on a client site by myself. So you can understand why i was getting very nervous when this particular server had been sitting at this screen for over 5 minutes (nearing on 10 minutes, but feeling like hours!)
I called back to the office and asked one of the other techs if they had seen this problem before, they said "yeah, sometimes they take a long time to shutdown"
So i thought, no worries, its just life.
But then on the drive home, i got thinking, "Surely someone else has had the same problem, i wonder if they found a fix for it?"
Then the google'ing began....
---What I Found---
After a while of searching I came across a small batch file that Daniel Petri had created. Basically it is a simple batch file that shuts down all the exchange services and stops other dependant services before shutting down (or rebooting) the server.
I tried this next time I was out onsite to do a reboot of the server.
I was amazed at the results, the server was down and up again in under 5 minutes! "Wicked!" I thought "This is the answer to the sites where reboots take a long time."
However I have found that some sites the batch file makes little or no difference, it seems the biggest improvements are only on sites where it has always taken a long time to shutdown/reboot.
The script has also been incorperated into Microsoft's KB (http://support.microsoft.com/kb/555526)
I downloaded the script from here: http://www.petri.co.il/slow_shutdown_of_exchange_2003_server_installed_on_dc.htm
But for convenience i will also paste it below (copy the text and save it as a .bat file)
Start of file:
@TITLE Reboot Exchange 2003 on DC script
ECHO º º
ECHO º Script by Daniel Petri º
ECHO º Updated on September 7, 2004 º
ECHO º ******************************* º
ECHO º º
ECHO º This script will will reboot Exchange Server 2003 when installed º
ECHO º on a Domain Controller. º
ECHO º º
ECHO º All Rights Reserved. º
ECHO º º
ECHO 1. Shut Down the server (shutdown /s).
ECHO 2. Reboot the server (shutdown /r).
ECHO 3. Abort shutdown (shutdown /a).
ECHO 0. Do nothing.
CHOICE /C 1230
IF ERRORLEVEL 4 GOTO END
IF ERRORLEVEL 3 GOTO ABORT
IF ERRORLEVEL 2 GOTO REBOOT
IF ERRORLEVEL 1 GOTO SHUTDOWN
IF ERRORLEVEL 0 GOTO END
SET PARAMETERS=/r /c "Stopper - Rebooting server"
SET PARAMETERS=/s /c "Stopper - Shutting down the server"
REM - While we are waiting for the main Exchange services to stop,
REM - Some peripheral services will be closed in the background.
start /min net stop MSExchangeMGMT /yes
start /min net stop RESvc /yes
start /min net stop POP3Svc /yes
start /min net stop IMAP4Svc /yes
start /min net stop NntpSvc /yes
start /min net stop SMTPSVC /yes
REM - Stop Exchange main services before shutdown to avoid timing conflicts.
net stop MSExchangeES /yes
net stop MSExchangeIS /yes
net stop MSExchangeMTA /yes
net stop MSExchangeSA /yes
REM - Well, why not stop other services in the background just for fun?
REM - Stopping IISADMIN will stop other dependant services like W3SVC, and HTTPFilter (SSL).
start /min net stop IISADMIN /yes
start /min net stop MSSEARCH /yes
start /min net stop Spooler /yes
REM - Now it's time to reboot or shutdown the server.
shutdown %PARAMETERS% /t 10
REM To abort, type:
REM shutdown /a
End of file.
I hope this will come in handy for some of you out there.
P.S. I would love to hear your comments on my first blog, any tips would be great :-)
Comment by freitasm, on 8-Sep-2009 21:43
I have been using this script for years now. And just today I shutdown my Exchange Server for the last time, after moving our accounts out to a hosted service...
Comment by Patrick, on 23-Sep-2009 15:52
Just wanted to know, I used it for the first time tonight -- worked like a charm. Considerably cut down on my systems reboot time.