Thursday, 14 January 2010

SBS 2008 – Speed Up That Reboot Script

A default out-of-the-box vanilla install of SBS 2008 RTM can take anywhere from 8-20 minutes to reboot depending on the hardware and disk I/O subsystem underneath the OS.

The following script will greatly improve those reboot times:

net stop msexchangeadtopology /y
net stop msftesql-exchange /y
net stop msexchangeis /y
net stop msexchangesa /y
net stop iisadmin /y

Please make sure to copy the above and paste it into Notepad to reveal any hidden errant characters inserted by the blogging service when this was posted.

Save the above into a batch file. When it comes time to reboot the server during updates, leave the Restart button and right click on the batch file and Run as Administrator.

Once the batch completes, which should only take a couple of minutes, click on the reboot button.

If the server needs to be rebooted and no Restart button is present, run the following after clicking Start:

  • shutdown –r –t 0 –f [Enter]

That will initiate a restart of the server.

Here are the reboot times not using the script and using the script for reference:

  • SBS 2008 RTM no SP2 fresh install VM:
    • 1057Hrs – Initiate shutdown.
    • 1107Hrs – System Off.
    • 1110Hrs – CTRL + ALT + DLT
    • Total Reboot Time: 13 minutes.
  • Same VM using the service shutdown script:
    • 1124Hrs – Initiate script.
    • 1125Hrs – Initiate shutdown.
    • 1127Hrs – System Off.
    • 1128Hrs – CTRL + ALT + DLT
    • Total Reboot Time: 4 minutes.

Indeed, there is a significant time difference!

Philip Elder
MPECS Inc.
Microsoft Small Business Specialists
Co-Author: SBS 2008 Blueprint Book

*Our original iMac was stolen (previous blog post). We now have a new MacBook Pro courtesy of Vlad Mazek, owner of OWN.

Windows Live Writer

8 comments:

  1. Glad you posted this Philip! I'm seeing the same shutdown times (4 minutes or just under) on vm's in Hyper-V and VMware, and on a physical install with the use of this simple script. In one server I was over 15 minutes waiting on the last shutdown via the start menu.

    Of course, it doesn't take much fancy work to have this script write its actvities (or just username and date/time) to a text file as a running log of restarts!

    ReplyDelete
  2. Jason,

    You are welcome! Thanks for sharing the script.

    Philip

    ReplyDelete
  3. is there any reason why you do not include the restart line in the bat file? Or is this not possible to do?

    About to give this a try and will let you know how it goes.

    ReplyDelete
  4. Yes, you can include it in the batch file. But, 9 times out of 10 we are running the script after updates have run.

    Better to use that restart button.

    Otherwise, not having it gives us pause just in case there is something we missed, users that may still be connected, or the like.

    Philip

    ReplyDelete
  5. Well that was quick response, thanks for that. Wasnt sure if there was specific issue with doing it that way.

    Can understand your points though in a working environment.

    I am just setting up some new servers (using your most helpful guide) and this will save quite a bit of time with the restarts etc that are necessary.

    My Details:
    SBS 2008 R2, 2x5420, 16GB DDR3, 7x 500GB SAS in RAID 10 + MaxIQ
    Just basic install, with required mainboard drives.

    Time from Start Restart to can Login
    Restart Normal - 10:27 server Off, 13:14 to C+A+D
    Restart Script - 1:10 Script Finish, 2:56 server off, 5:58 to C+A+D

    So arh, yeah, definitely going to be using this from now on!

    ReplyDelete
  6. Thanks Philip for the great batch. I wanted to know if you can include in the batch command for shutting down the Windows Update Service which takes time as well. Also I would like to buy your book "SBS Blueprint" but I am afraid that by the time the book arrived I'll be done with SBS setup. Lol.

    Thanks,
    Joseph

    ReplyDelete
  7. Does this work as is for SBS 2011?

    ReplyDelete
  8. The ComputerWhisperer18 October, 2012 23:26

    Great little script.... just what I was looking for.

    I would personally add an extra line to the bottom of the script of:

    pause

    That way, when the script has finished it leaves all the processing text on the screen with all the success or failure messages, and asks you to press any key to finish. Seems better to me. Could save you from seeing something flash up that worried you, just as it was closing the window automatically...

    I also have a question about why it saves so much time. Is there some checking/scanning that normally done during the shutdown/restart process does that is skipped by this method? ie is it totally safe to use long term on every reboot?

    Mike

    ReplyDelete

NOTE: All comments are moderated.