SBS 2008 has an awful lot running on it. It’s not surprise therefore when you find that it takes quite some time to shutdown the server. I’ve seen my own server take 15 to 20 minutes to do a shutdown. The secret to understand is what goes on during the shutdown process. The shutdown process is the reverse of the startup process. What I mean by this is that in the start-up sequence, after the basic bits of Windows operating system loads, the server goes through the list of services alphabetically and starts them up. This can lead to “interesting” results as some services depend on others being started and therefore they fail to start correctly. Most services therefore have dependencies linked together so that they force start services they need which may not normally start until later in the process. This is how Windows gets around it and makes things work… most of the time 🙂
The reverse is then true for the shutdown process. The Windows operating system starts to shutdown the services alphabetically from the top down. Interestingly though, the dependencies don’t work in reverse. This leads to things like Exchange actually not shutting down correctly and therefore taking time as it times out waiting to talk to things that have already been shutdown. Lucky though the fix is simple. Given Exchange is the key thing waiting to shutdown, if we start the shutdown of that FIRST, while Active Directory and other key services are running, then the entire process goes much faster and more smoothly.
Ok – to fix this – we need a script. The script needs close down the main Exchange services in an orderly fashion and then we can commence shutdown of our SBS 2008 server. Here’s the script we need
net stop msexchangeadtopology /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop iisadmin /y
Ok – bundle that up and put it in a text file with a .cmd extension and you’re good to run it whenever you want to shutdown SBS 2008 quickly. Here’s a link so you can download the script and make it easier for you.
The next thing you will want to do is to implement this so that it automatically runs on your SBS 2008 server whenever a shutdown is started. You can do this using group policy. Use the Group Policy Management console to create a new Group Policy called Faster SBS Shutdown. Edit the group policy so that it runs this script as a shutdown script. You can see I’ve store the script in a folder on the SBS server called C:\scripts. Link that Group Policy to the Domain Controllers OU in your domain as you can see below.
The next time you go to shutdown your SBS 2008 server, it will automatically run that script and stop the services in the order described BEFORE it starts it’s normal shutdown process.
I have been using a variant of this script since NT4 and Exchange 4. Pretty strange that Microsoft cant just fix this in a better way. But your idea of putting it in a gpo and making it automatic is great, thanks for that!
Wayne Small says
Yes – i’ve done similar, but have never botherd to put it into a GPO till more recently and I figured others would think the same. Thanks for the comment.
The Muj says
I’ve applied this to an sbs 2008 server that I am working on, its improved but still takes a while. Any recommendations on other services that may be taking forever and a day to time out?
Or just add the folowing line to the end of the script:
and throw the script on the desktop. Run it to do the shutdown for you.
This drops my reboot times from about 16 minutes to about 10 minutes.