Tip

Simple scripting gets Exchange Server moving

If you've ever had to restart your Exchange server for any reason (and you likely have), then you've probably noticed how long it can take.

As a general rule, any server that is functioning as an Exchange server takes longer to restart than a comparable server performing other tasks. Member servers hosting an Exchange installation take slightly less time to restart than does a DC/GC hosting an Exchange installation, but the restart time is still lengthy compared to most other servers you are likely to work with.

The key to this problem lies in the shutdown of the Exchange services. If you don't want to wait 10 minutes or even longer in some cases, you can force the issue by stopping the Exchange services yourself and then initiating the restart. I've included a sample batch file that you can use to perform a quicker restart on your Exchange Server 2003 servers.

Try this:

 REM Restart Exchange Server 2003 faster
REM Batch file 2004 by Will Schmied (www.mcseworld.com) for SearchExchange.com

REM You can remove entries that pertain to services not running on your Exchange Server
REM You can change many of the options in the shutdown.exe command to suit your needs

REM ** Stopping Exchange Server typical services **
REM Stopping the Microsoft Exchange Information Store service
sc stop MSExchangeIS
REM Stopping the Microsoft Exchange MTA Stacks

    Requires Free Membership to View

service
sc stop MSExchangeMTA
REM Stopping the Microsoft Exchange System Attendant service
sc stop MSExchangeSA
REM Stopping the Microsoft Exchange Routing Engine service
sc stop RESvc
REM Stopping the Microsoft Exchange Management service
sc stop MSExchangeMGMT
REM Stopping the Microsoft Search service
sc stop MSSEARCH

REM ** Stopping Exchange Server specialty services **
REM Stopping the Microsoft Exchange IMAP4 service
sc stop IMAP4Svc
REM Stopping the Microsoft Exchange POP3 service
sc stop POP3Svc
REM Stopping the Microsoft Exchange Site Replication Service
sc stop MSExchangeSRS
REM Stopping the Microsoft Exchange Event service
sc stop MSExchangeES

REM ** Restarting server in 45 seconds, force close running applications **
shutdown /r /t 45 /f /d p:0:0 /c "Restarting Exchange Server"

 My results: less than half the time
On my test server, a normal restart (immediately following a clean startup with no errors) took 12 minutes and 40 seconds to complete from the time I clicked OK after entering the reason in the Shutdown Tracker to the time the logon prompt was available. By comparison, when using the script (again, immediately following a clean startup with no errors), the restart took 5 minutes and 15 seconds to perform from the time I initiate the script to the time the logon prompt was available.

The test server I used was not one that you would consider production quality. It contained a Pentium 4 1.6 GHz CPU, 768 MB of PC 2100 DDR RAM and a single 60 GC EIDE 7,200 RPM hard drive. The server is configured as a Windows Server 2003 DC, GC and Exchange Server 2003 server. One storage group with two stores exists, with each store less than 30 MB in total size.

Even though this is hardly a production quality server, it does serve well to illustrate that you can achieve quicker Exchange Server restarts by using some simple scripting.

Will Schmied, BSET, MCSE, MCSA, is a systems engineer for a Fortune 500 shipping and transportation company. As a freelance writer, Will has written for Microsoft, Pearson, Sybex, Syngress, TechTarget, CNET, msexchange.org and several other organizations. Will has also worked with Microsoft in the MCSE exam-development process. You can visit Will at his MCSE certification portal, www.mcseworld.com.

This was first published in May 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.