Securely Reboot Server via Email

added on January 23, 2007 by Joe Church (
Applies To: AutoMate 6, AutoMate 5

This task will check a POP3 e-mail server (you will need to customize to fit your settings). It will download messages and check two things before it acts, first it will look for the word reboot in your subject line, if its not there, forget it, task ends. Next it checks the message body for a keyword or "password". You can also customize this to fit your needs. If those two conditions are met, it will proceed to break apart your subject line into something it can use.

Message format must be sent as:

To: (this is the account you will check with automate)
Subject: reboot servername (must contain the word reboot followed with a space and then the name of the host or servername you wish to reboot).
Body: yes (in this task the password is "yes". Body must contain your password before it will proceed).

If the two above checks are not met, you will receive an e-mail message warning you that an attempt to reboot via e-mail failed. You can customize this with a distribution list or individual address.

You can also customize this task further, by adding checks for the sender address, if you only want certain people to be able to reboot via e-mail, for example you can check if a senders address = X, if not, stop the task. You can also add more variables, such as delay time, reboot or shutdown flag, etc. For example, you could customize this code further, so that sending an e-mail with the subject of: "reboot myservername r 300" would accomplish the following...

whatever servername you entered
actually reboot, not shutdown
delay reboot or shutdown by 5 minutes

This probably won't be allowed in most larger corporate environments, but it was a lot of fun to write and might come in handy for a busy sysadmin in a smaller job.

Download This Task (0kb) Reboot Server by E-mail (1).zip
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 (1)

  1. 9/11/09 by Derrick Vandekraats
    This opens a world of possibilities. While I have a few tasks that monitor specific applications and restart services, sometimes there is no one action fixes all faults scenario. I can use the principles of this task to restart specific services and then wait back for confirmation and update if fault is corrected. I can choose which services and in which order I want to work with them. If that doesn't work, I can always resort to rebooting the server as a last attempt before coming to site. All this from my cell phone - cool!
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.6 changelog
11.0.6 changelog
other versions downloads


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