Bulk Server Reboot Automation

added on January 10, 2008 by Joe Church (joseph.church@transammonia.com)
Applies To: AutoMate 6, AutoMate BPA Server 7

Requirements:
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.

Description:

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!

Download This Task (15.5kb) Reboots-Beta-Share.aml
Would you like to upload a Sample Task or Workflow to the User Resource Center? Click here!



More Sample Tasks and Workflows

JSON Loop Structure, Encode, Decode Sample (task) 4/30/17Leonard Amabile

This sample task will demonstrate the following: - Decode JSON string into structure/array - Loop structure/array and display values - Encode structure/array into JSON string (raw or formatted)

Round up to Whole Number Using VB Round() Function 4/24/17Leonard Amabile

The VB round() function, by default rounds to the nearest whole number based on the following: 10.00 through 10.50 = 10 10.51 through 10.99 = 11 There are scenarios where you want to round up all decimal values to the nearest whole number. Based on the above criteria, adding 0.5 to any numeric value with a decimal will cause the round() function to round up. For example: 10.00 + .50 = 10 round(10.5) 10.10 + .50 = 11 round(10.6) 10.90 + .50 = 11 round(11.4) The attached tasks will demonstrate the round() function usage to round up numeric values.

Restart a Service (Automate and Intermapper) 3/27/17Network Automation

This sample task will allow you to use Automate and Intermapper to restart a service.

DDE Sample (task) 2/24/17Leonard Amabile

The attached task demonstrates DDE Execute, DDE Poke and DDE Request. The task assumes that Excel is running with a worksheet named Sheet1. DDE Execute: Maximizes the Excel spreadsheet. DDE Poke: Will write the number 7 in row 1 column 1 of Sheet1. DDE Request: Will grab the value from row 1 column 1 of Sheet1 and populate variable varTest.

Workflow Loop Sample (workflow) 8/22/16Leonard Amabile

This sample demonstrates how a workflow loops through a shared dataset using the evaluation object and NO loops within the tasks.

Inline Padding Sample (task) 8/22/16Leonard Amabile

This sample demonstrates how to pad a string inline with leading or trailing spaces.

Split filename into two variables 5/15/15Valentineo McGowan

A task has a name of 'abc_123.txt' I would like the folder name to be the prefix of the filename prior to the "_" delimiter 'C:\abc'. File 123.txt will then be placed inside C:\abc\123.txt

Count Rows in TXT/CSV using Regular Expression 5/15/15Valentineo McGowan

I have a *.txt or *.csv containing column headers and X rows of data. Using RegEx the task simply counts the number of rows based on carriage returns. Great for csv files that have X amount of records and you simply need a total count of rows minus the headers.

Dataset to CSV File using Excel action 5/15/15Valentineo McGowan

How do I create a CSV file from a dataset without using Interactivity actions inside MS Excel, ie, 'File Save As.'? Here's how to create a CSV file in one step using a dataset with our 'Excel - Set cells' activity.

Dataset to CSV using ODS action 5/15/15Valentineo McGowan

How do I create a CSV file from a dataset without Microsoft Excel being present on my machine? Here's how to create a CSV file in one step using a dataset with our new 'ODS (OpenDocument Spreadsheet) - Set cells' activity.

 

Comments (5)

  1. 3/17/10 by Johnny Olofsson
    This could be very useful in our busines but how do I enter the passwords and usernames if I have 60 servers with different credentials?
  2. 3/22/10 by Leonard Amabile
    Hi Johnny, You can store the server names, usernames, and passwords in an excel spreadsheet and then create a dataset against this spreadsheet. You can then loop through the dataset and reference the data accordingly. Leonard Amabile Network Automation, Inc.
  3. 1/17/15 by Marlene Londt
    hi this works perfectly on our "old infrastructure". Now i have edited it slightly and created a new reboot task reading the server list from a table. That seems to work, but now a new server in the infrastructure does not want to reboot. Are there any settings that you need to set on a server in order to be rebooted by this task? Thanks! Marlene
  4. 1/24/15 by Leonard Amabile
    @Marlene Londt - There should not be any other settings required for the workstation to reboot. Make sure that the task is running elevated. If the issue persists, please open a support ticket.
  5. 6/16/16 by Anonymous
    https://remoterebootx.com/ ITS FREE
Please sign in to your account or your comment will be forever stored under "anonymous".
Include Code Snippet

Search the URC

Subscribe to Version History via RSS
Subscribe to Version History via RSS
Version Watcher

11.0.1 changelog
11.0.1 changelog
other versions downloads

Contribute

Subscribe to Latest Resources via RSS
Subscribe to Latest Resources via RSS
Latest Resources

show filter options

Subscribe to Forum Posts via RSS
Subscribe to Forum Posts via RSS
Forum Posts