Thursday, 31 May 2007

SBS 2K3 - All Versions: Scheduling a reboot as a "just in case" when patching

Susan Bradley just wrote a post that is perhaps one of the best pearls of wisdom I have come across in a very long time: Brilliant idea regarding patching.

The following is the methodology for that idea.

I can't count the number of times that we have been patching Exchange, ISA, or even the server OS itself and we have been kicked off. No RWW access, no access via VPN.

The only respite in that case was, up until this point, to have someone log in and reboot the server, head down to the client site, or have a back door into the system.

So, how do we schedule a reboot?

It is actually very simple.

  1. Log on to the server as admin.
  2. Right click on the desktop and create a new text document.

  3. Call the new file something like, "Schedule Server Reboot.bat". Note the extension change to a batch file!
  4. Answer Yes to the warning that comes up.

  5. Right click on the new batch file and Edit it.
  6. Type the following in the batch file:
    • shutdown -r -t 30 -f
      • The -r is for Restart, the -t is the time delay for the restart with the amount of time expressed in seconds after it, the -f forces the shutdown no matter what service tries to deny it. This last one is VERY important.
      • You can change the time delay to whatever you want to. We suggest 30 to 90 seconds. This time setting is not the way to "schedule" the reboot by the way. Continue on for that.
  7. Go to Control Panel and then Scheduled Tasks.
  8. Double click "Add Scheduled Task".
  9. Click Next.
  10. On the "Click the program..." click on the Browse button.


  11. Navigate to the desktop, and click on your batch file, then the Open button.
  12. Perform this task: "One Time Only"
  13. Set the task to run an hour or more ahead depending on the updates you are running. To be on the safe side, add 50% more time to the time you come up with. Scotty's rule you know! ;)
  14. Enter your admin log on credentials.
  15. You will be greeted with the following:

  16. Click Finish.
If you get disconnected during the updates, wait for about 10 or so minutes after the prescribed time depending on how long your server takes to reboot, and you will be good to go! Hopefully that is. :*D

Susan, awesome tip! Thank you very much for sharing it as it solves a dilemma many of us would never even have come close to figuring out.

Kudos to the person who shared the tip with Susan!

UPDATE 2007-06-05: One thing that I missed with regards to the remote reboot!

Make sure to leave the Scheduled Tasks window open so that you can delete that scheduled task if you do NOT get kicked off your RDP session!

Otherwise, you will get a surprise when the scheduled reboot kicks in if you are still working on the server!

Philip Elder
MPECS Inc.
Microsoft Small Business Specialists

1 comment:

  1. Hi Philip,

    we have used this method for some years now.
    Instead of deleting the batch job, we simply disable it to prevent it from running (rightclick on the job, choose 'properties', then uncheck 'activated').
    Just remember to re-check the box again before doing the next update session remotely.

    Thanks for your great work!

    bfg

    ReplyDelete

NOTE: All comments are moderated.