How to Cancel All Orchestrator jobs with SQL

When automated systems go wrong you may need to cancel a backlog of pending or running Orchestrator jobs directly with SQL.

For reference, the StatusId field from Orchestrator’s Job table provides the current status of the job.  These numeric represent:

0 = Pending

1 = Running

2 = Failed

3 = Cancelled

4 = Completed

The script may be run directly with SQL Management Studio.

PowerShell DSC Encryption

PowerShell’s Desired State Configuration allows for routines or classes to be run on remote machines by passing a text based “properties” object to the destination end-node.  There are a growing number of Microsoft supplied “classes” and importantly, the framework allows for custom development of additional objects.

MOF Files define the inputs to the class that will be run remotely.

Retrieving REST based results from SMA Runbooks

In a previous example, I gave an example of running a simple Service Management Automation runbook using REST.  This blog demonstrates how to retrieve output from a called runbook by using platform independent REST calls against the SMA Server. 

Four steps exist in obtaining the output from an SMA Runbook: