Kicking off SMA Runbooks from Orchestrator

Author by Duncan Lindquist

The first step when setting up an SMA runbook for orchestrator to kick off is to set our parameters. These will be the parameters that we pass from Orchestrator to SMA. To do this we define our parameters the same way we would in a normal PowerShell script. Below is an example of some test parameters. SetParams1
Now if you hit the test button on your script you will see a pop up box prompting your for your parameters. This will look very similar to the initialize data activity in orchestrator.

Prompts2

In order to access the SMA runbooks from Orchestrator we will need to use powershell. The powershell module for SMA can be installed from the Orchestrator R2 installer.

Powershell3

Once we have the module is installed we can run the start-smarunbook command! To do this we will need to specify three things. First is the web service endpoint this is the URL for the SMA web service. Second we will need the name of the runbook. Third we will need the parameters that we will want to pass on.Now that we have these three things we can build out our powershell command in orchestrator.
PassingData4

Now if you run your Orchestrator runbook you can see that it has run in the dashboard section of your SMA runbook.

Dashboard5

If you click on the job you will be able to see the parameters that you passed along.
parameters6
If you want to kick off an Orchestrator runbook from SMA you can checj out this blog post from Tiander. Enjoy building your SMA runbooks!

Author

Duncan Lindquist

Service Management & Automation Solution Lead