Skip navigation
Talk to Orchestrator From Windows PowerShell

Talk to Orchestrator From Windows PowerShell

Q: Do you have any examples of Windows PowerShell scripts to generate a list of Orchestrator Runbooks that then allow a Runbook to be executed, including prompting for necessary parameters?

A: I had this very requirement for a PowerShell course. Below is the full code, which initially generates a list of Runbooks available, then in a Gridview, allows one or more to be selected.

After you click OK, it will prompt for the required parameters and run each runbook selected. I hope it's useful to you.

Change the first $baseurl to the URL of your Orchestrator web service. You can download what you need from my Savilltech website.

The first part of the code fetches all runbooks and stores information in a hash table so it can be outputted to a Gridview. After you select one or more, and you click OK for each selected runbook, it fetches the parameters for the runbook, then prompts for the values, then triggers the runbook giving.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish