Tutorial - Running a Windows Task

 

To perform this tutorial, you need a running Universal Agent for Windows.

Creating a Simple Windows Task

Step 1

From the Automation Center navigation pane, select Tasks > Windows Tasks. The Windows Tasks list displays.

Step 2

In the empty Windows task Details below the list:

  • In the Task Name field, enter stonebranch-windowstask-01.
  • In the Agent field, select your Windows agent.
  • In the Command field, enter md c:\tutorial.

Step 3

Click Save.

Step 4

On the Windows Tasks list, right-click stonebranch-windowstask-01 to display an Action menu.

Step 5

Click Launch Task.

Step 7

Check the Activity Monitor for the task instance.

Manually Retrieving Output from a Windows Task

In this Windows task, we will run a DIR command. Normally, you would use the Automatic Output Retrieval field to specify that any output generated by the command be attached to the task instance after the task completes. However, if you did not specify that output be attached, you can manually retrieve it after the task instance has run. In this exercise, we will manually retrieve and display the output.

Step 1

Use the same steps to create another Windows task called stonebranch-windowstask-02. Do not specify Automatic Output Retrieval, and use the following command:
 

Step 2

Save and launch the task.

Step 3

Locate and open the task instance on the Activity Monitor.

Step 4

Note that the Output tab is empty. Click Retrieve Output. The Retrieve Output window appears:
 

Step 5

Change the number of lines to 300 and click Submit.

Step 6

Click the Output tab. The STDOUT (standard output) displays on the output list, as shown in the following example:
 

Attaching Output to an Email Notification

In this exercise, we will modify the stonebranch-windowstask-02 task with an Email notification that includes the output from the DIR command.

Step 1

Open the stonebranch-windowstask-02 task.

Step 2

Click the Actions tab.

Step 3

Click Email Notification and then click the New button.

Step 4

In the Email Notification Details, specify the following:

  • Status=Success
  • Email Connection=Your email connection
  • To=Your email address
  • Subject=Output
  • Body=See attached.
  • Attach Standard Output=enabled
  • Start Line=1
  • Number of lines=300
     

Step 5

Click Save.

Step 6

Launch the stonebranch-windowstask-02 task.

Step 7

Once the Windows task goes to success, check your inbox for the email. The output is attached, as shown in the following example.
 


For additional information, see: