The following table provides an overview of the different goals you might have when creating tasks, and how you can achieve those goals:
If you... | Then... |
want to schedule patch updates on devices once a month, a few days after Microsoft releases patches on the third Tuesday of the month | Schedule a recurring task that installs patch updates on devices, and takes place on the fourth Tuesday of each month. |
want to set up a task with the parameters pre-set, that you know you will reuse often. For example, a task that sends users a message that you will be performing maintenance on their devices, and they might experience an interruption | Create a quick task then type a message notifying users of the planned maintenance. Add the quick task to your favorites. The quick task can be run directly on a device using a quick link. |
want to execute a basic command line task | Set up a task to run immediately. |
When you add a task, you perform these steps:
- Choose whether to run the task immediately or schedule it to run later.
- Select the script or automation package to include.
- Set the task parameters.
- Add the task to a device or group.
- (Optional) For tasks scheduled to run later, add a recurrence.
- Set advanced configuration settings, such as alert configurations and task timeout settings.
When you save the task, it is added to the Calendar, which you can then use to view upcoming tasks, check the progress and results of completed tasks, and edit tasks if necessary. See Viewing Tasks.
To add a task and select a script
- In Service Center, click Automation > Calendar.
- Do one of the following:
- Click Run Now to run the task immediately.
- Click Schedule to run the task at a future time.
- From the Choose what to execute list, do one of the following:
- If you have flagged scripts or packages as favorites, they will appear in this list. Click a favorite.
- Click (Item from library), then:
- Use the filters to narrow down the list of scripts and packages; or
- If you know the name of the script or package you want to use, start typing it in the Choose an item by name list.
To add a task to a device
- In the Target Devices area, click Add.
- Filter the results by selecting the appropriate items and click Filter.
- Select the check boxes for the devices to which you want to apply the task.
- Click Add.
- Repeat steps 1 to 4 until you have included all devices for the task.
To add a task to a group
- In the Target Groups area, click Add.
- Select the check boxes for the groups to which you want to apply the task.
- Click Add.
- Repeat steps 1 to 3 until you have included all devices for the task.
To run the task once at a scheduled time
You can set a task to run at a scheduled time or to run the next time the target device reboots.
- In the Schedule area, click the calendar icon and select a date or type a date.
- Click the clock icon and select a time of day or type a time.
- To run the task after a device reboots, select the Run on next reboot after this time check box.
When you select this check box, the task will run the next time the device reboots after the date and time you selected in steps 1 and 2. - Click Schedule.
To run a task on a recurring schedule
- In the Schedule area, click the calendar icon and select a date or type a date.
- Click the clock icon and select a time of day or type a time.
- Click Add Recurrence.
- Do one of the following:
- To run a task daily, select the Daily option button, then specify how often the task will run each day by selecting a frequency from the Run daily list. By default, daily tasks run once a day.
- To run a task weekly, select the Weekly option button, then specify what day or days to run the task.
- To run a task monthly, select the Monthly option button, then select either a specific date or a recurring day in the month.
- Click Schedule.
To set a timeout on a task
- Click Show Advanced Configuration.
- In the Timeouts area, set the following timeouts:
- To set a timeout for the execution of the task, from the Execution list, select the length of time the task can execute before the timeout occurs.
- To set a timeout for when the device is unreachable, from the Device Unreachable list, select the length of time the task can be unreachable before the timeout occurs.
- Click Schedule.
To wake a computer to run a task
You have the option to wake a computer if it is asleep so that the task can be run at the scheduled time.
- Click Show Advanced Configuration.
- In the Miscellaneous area, click the Wake Computers check box.
- Click Schedule.
To email execution results to the task scheduler
You can choose to have the task execution results emailed to yourself.
- Click Show Advanced Configuration.
- In the Miscellaneous area, click the Email Results check box.
- Click Schedule.
To add an alert if the script fails to be executed or returns output that is not considered a successful execution
You can specify alerts when the script fails to be executed or returns output that is not considered a successful execution.
- Click Show Advanced Configuration.
- In the Alerts - Execution Results area, click Add.
- Type a title for the alert.
- Optionally, type a description for the alert.
In the Alert Rules area, click Add.
If you are scheduling a script to run as a task, select the parameters that will generate an alert:
Return Code Indicates the execution outcome of the script. The return codes can vary because they can be defined inside the script itself.
Standard Output Indicates the output produced, if any, by a task to the StOut. Standard output is used to express anything the script needs to communicate. This can be error messages, success messages, or lists of data.
Standard Error Indicates the error produced by the script.- If you are scheduling an automation package to run as a task, select one or both of the following:
- To alert on the package result, select the Package Result check box, and then select the package result that will generate an alert (Any, Completed Successfully, or Completed With Errors).
- To alert on the notification conditions set for scripts in the package, select the Package Notification Flag Set check box. This generates an alert based on the alert conditions that were set on individual scripts in the package when the package was created or modified. For more information, see Set Up Alert Conditions for Scripts in a Package.
- Do the following:
- To add an alert category when a script fails to be executed, click Categorize Alert and add a category from the list.
- To remove an alert category for when a script fails to be executed, click Categorize Alert and remove a category from the list.
- To create a trouble ticket when a script fails to be executed, select the Create Trouble Ticket check box.
- To set the alert to self-heal when a script fails to be executed, select the Self-Heal check box. To specify the setting for self-heal, click the Self-Heal link. To clear the associated Trouble Ticket, ensure the Clear Trouble Ticket check box is selected. To send a notification, select the Enable Self-Heal Notification check box and specify the time delay. Then click Save.
- To send an email when a script fails to be executed, select the Send Email check box and select either All users to send an email to all users whose role is to receive alert notifications or select Specify email addresses to specify certain recipients who should be notified. In the From box, type the email address from where the alert is emailed.
- To escalate an alert if an alert has not been cleared or self-healed in a set amount of time, select the Escalate Alert check box and select a time after which the alert escalation will take effect. Select the Send Email check box and follow the instructions in the previous bullet.
- To automate reactions to an alert, select the Run Script check box and select the Category and Script name, set any parameters if necessary and specify whether you want it to run on the device or Onsite Manager.
- Click Schedule.
To add an alert if the script fails to be delivered
You can specify alerts for delivery failures when you schedule a task to run in the future.
- Click Show Advanced Configuration.
- In the Alerts - Delivery Failures area, click Add.
- Do the following:
- To add an alert category when a script fails to be delivered, click Categorize Alert and add a category from the list.
- To remove an alert category for when a script fails to be delivered, click Categorize Alert and remove a category from the list.
- To create a trouble ticket when a script fails to be delivered, select the Create Trouble Ticket check box.
- To set the alert to self-heal when a script fails to be delivered, select the Self-Heal check box. To specify the setting for self-heal, click the Self-Heal link. To clear the associated Trouble Ticket, ensure the Clear Trouble Ticket check box is selected. To send a notification, select the Enable Self-Heal Notification and specify the time delay. Then click Save.
- To send an email when a script fails to be delivered, select the Send Email check box and select either All users to send an email to all users whose role is to receive alert notifications or select Specify email addresses to specify certain recipients who should be notified. In the From box, type the email address from where the alert is emailed.
- To escalate an alert if an alert has not been cleared or self-healed in a set amount of time, select the Escalate Alert check box and select a time after which the alert escalation will take effect. Select the Send Email check box and follow the instructions in the previous bullet.
- To automate reactions to an alert, select the Run Script check box and select the Category and Script name, set any parameters if necessary