How does the Task Server Client Task Service Control Work?
search cancel

How does the Task Server Client Task Service Control Work?


Article ID: 176711


Updated On:


IT Management Suite Task Server


The screen capture below displays a Task Server 6.x Client Task Named "Service Control."

As indicated by the highlighted portion of the screen capture, one of the service actions is the ability to determine the status of a Windows Service. How does this service action work?


The Task Server Client Task "Service Control" can be confusing because an administrator might expect that running the task will return string values that correspond to the values seen in the Windows MMC for Services. For example, the screen capture below shows the Windows Services MMC. Notice that the "Status" column displays the word "Started" for the "Altiris Agent" service.

When the Task Server "Service Control" Client Task is run, notice in the screen capture below
that the Status Display does not match the Windows MMC:

The Task Server Status in the screen capture above is accurate and is working as designed. The Task Server Summary is designed to allow the Altiris Administrator to determine if the Task itself ran properly, and in the screen capture above the Task has run successfully.

Double-clicking on the "Resource Name" in the screen capture above provides the information that corresponds to the Windows MMC as seen in the highlighted screen capture here:

While knowing this information for a single machine is useful, if the status information must be used for reporting purposes on multiple computers, there are several additional details that must be understood.

When a Task Server Client Task is run, the results from the client are stored in the Notification Server database table named TaskOutputPropertyValue. This is true for all Task Server Client Tasks, not just the "Service Control" task. Using SQL Management Studio (or Query Analyzer) and running the following statement:

Select * from TaskOutputPropertyValue

will reveal that when the "Service Control" task is run, the client computer returns an integer, not the string value. In other words, the word "Running" will not be found in the table, instead, the integer "4" will be found. The following table can be used as guideline for translating the integer values to the string values.

0 = Unknown
1 = Stopped
2 = StartPending
3 = StopPending
4 = Running
5 = ContinuePending
6 = PausePending
7 = Paused

In the final screen capture above, notice that the word "Running" is displayed. This is because the translation process from integer to string value is done automatically by a stored procedure named spLoadTaskOutputPropertyValue each time the dialog is opened. Keep in mind the translation process will not happen automatically if a custom report is created, or if the SQL database is queried directly.