Posts Tagged Rolling Reboot

Script to reboot all servers in a network

Windows updates almost always require that you reboot your servers after a round of patching. Windows Admins would not really envy the task of rebooting servers after patching.
I have created a script that does the following:

  1. Reboots all servers defined in a simple text file. 
  2. Reboots servers one at a time in a “rolling reboot” fashion.
  3. Notifies you if a server hangs at any point in the reboot cycle (during shutdown, POST or boot up. There are parameters that can be configured to adjust the script to your network.
  4. Checks to make sure that the RPC server service has started up before going onto reboot the next server.
You can download the script here.
To use the script, do the following:
  1. Extract the script to a location (preferrably on your second domain controller/DNS server)
  2. Edit the batch file and edit the parameters between *** TUNEABLE PARAMETERS ***. Update the mail server, to and from info here if you would like email alerts, please remember, if you are rebooting your mail server as part of this, you should use another external relay method to send emails.
  3. Edit the serverlist.txt file. This file should be populated with a list of servers in the order they will be rebooted in. Always exclude the name of the server you are performing the reboots from if you need to reboot it as well. Include all servers only if you are performing reboots from a workstation. In this case, you will need to ensure that the workstation can resolve DNS names for all the servers being rebooted.
Suggestion: The way I’ve always deployed the script is to run it on the second domain controller + DNS server and not include that domain controller in the list at all. This ensure that there is a logon server available at all times and that DNS resolution necessary for the script to function is available.
Let me know if this has helped you!

, ,

No Comments