Running a Windows Task
From OpsWise Documentation Wiki
To do this exercise, you first need a running Windows agent.
Contents |
Viewing Information about the Agent
When you install and start an agent, information about the agent is automatically registered and added to the OpsWise Automation Center database. To view the information:
- From the navigation pane, select Resources > All Agents. Depending on what agents are running, you will see a list similar to the following:
- Note that the Status column indicates whether this agent is running and accessible. Click on the Agent Name for your Windows agent. Details for the agent display, as shown in this example.
- Most of the information is protected. See Agent-Based Resources for information about which fields you can change.
Creating a Simple Windows Task
- Select Tasks > Windows Tasks and click New.
- In Task Name, type Making Dir "Tutorial".
- In the Agent field, select your Windows agent.
- In the Command field, type:
- Click Submit.
- From the Agent list, right-click on Making Dir "Tutorial" and select Launch Task.
- Check the Activity screen for the task instance.
md c:\tutorial
Retrieving Output from a Windows Task
In this Windows task, we will run a DIR command. After running it, we will retrieve and display the resulting output.
- Use the same steps to create another Windows task called Dir with Output. Use the following command:
- Save and launch the task.
- View the task on the Activity screen, and click on the name.
- Note that the Output tab is empty. Click Retrieve Output. The Retrieve Output window appears:
- Change the number of lines to 300 and click Submit.
- Click the Output tab. The STDOUT (standard output) displays on the output list, as shown in the following example:
dir c:\windows
Attaching Output to an Email Notification
In this exercise, we will modify our DIR Windows task with an Email notification that includes the output from our DIR command.
- Open the Dir with Output task you just created.
- Click the Actions tab and click New.
- Select Email Notification.
- 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
- Click Submit.
- Launch the task.
- Once the Windows task goes to success, check your inbox for the email. The output is attached, as shown in the following example.





