Bulk Server Reboot Automation
Automate the rebooting of multiple servers
1. folder structure of C:\Automate\Reboots on the root of your C Drive.
2. Text file in the Reboots folder named servers.txt. Each server should be on its own line.
3. Set credentials in the first few variables, these should have admin rights on all target servers.
4. You must download the Microsoft uptime.exe tool from the microsoft download site. Put uptime.exe in the Reboots folder.
This task will read in a text file that lists all the server names that you want to perform a reboot on. It will first ping the server to verify its online. Next it will gather uptime data for the target server. Next a reboot command is sent over the network. The task will then ping the server and wait for it to go down for reboot. Next it will begin pinging waiting for it to come back online. Once back online, the task then gives it a few minutes to full startup. Next the task will check for a specific service status. Here is where more customization is needed, in that you can specify more than one service, or different services, and alter the progress of the task based on the results. For this task, we only check the service "Workstation". If the service is running, we move on the next server and repeat all of the above.
This task is designed to automate the rebooting of multiple servers. It has error checking built in and will terminate if any errors are encountered. A server being unpingable will generate a log entry but the task will continue with a different server in the list. The goal here is to have the task stop if there are problem, as one server being down could affect many others, so the task will wait for each server to come online and verify specific service status before rebooting the next server. This is useful when you have dependent servers that rely on any single server. Task results are sent via e-mail and all actions are logged. I added comments throughout the task to show you what the task is doing. Enjoy!