I recently ran across the question of “How Can I Launch a Runbook from a Console Task?” in this forum thread:
I started thinking about how this could be useful in certain scenarios and how this would work. I decided to figure this out and blog about it so here it is. First you will need a tool that can connect to Orchestrators web service and start runbooks. There is such a tool called Orchestrator Remote Tools 2.51.
With this tool you also have the ability to discover information about runbooks on an Orchestrator server, pass parameters to the tool and see the status on if the runbook started successfully or failed. This tool has a GUI and command line interface.
This tool only discovers runbooks that have an “Initialize Data” activity. This tool launches runbooks looking to a generated .XML template with information about the runbook or it can launch runbooks directly without the XML template file (CLI mode only). for The tool consists of three components:
- UI Generator (ORTUIGenerator.exe): This is what discovers all your runbooks and allows you to browse them. You also use this component to generate the XML template files.
- Remote Runbook Launcher (ORTRunbookLauncher.exe): Is the graphical way to launch runbooks.
- Remote Runbook Launcher CLI (ORTRunbookLauncherCLI.exe): Is the command line way to launch runbooks.
You can learn more about the tool here:
It can be downloaded here:
Let’s work with the tool to prepare for using it with Service Manager. Create a share on your Service Manager management server. This can be something like \\SMSERVER\ORT\.
Copy the Orchestrator Remote Tools into it. You should have the following:
Now click on ORTUIGenerator.exe . You will see this popup message:
Click OK. This is telling you it is the first time you have run the tool and you need to put in your Orchestrator settings.
You will see the following window and will need to complete all the fields.
NOTE: Once you put in the data base server it will automatically pull in the Orchestrator database. If your SCORCH DB is not named Orchestrator you will be able to click the drop down and select it.
Click Save when you are done. Clicking Save will create a Config.xml file in your ORT directory.
Now the UI Generator window will pop up. This is the window you use to generate the .XML template file.
On the left hand side you are able to browse through the discovered runbooks. Keep in mind it only finds runbooks that have an “Initialize Data” activity. To configure the template for a runbook browse to it on the right hand side, select it and click the “Get details for the selected runbook” button. It will then expose the settings of the “Initialize Data” activity for the runbook on the right hand side. Here is where you can configure values for the parameters and give the runbook a description for those that will be running it. Note you are not required to configure values for the parameters. When you are ready to generate the .XML template click on the “Create Runbook Launcher configuration file” button.
You should now have a policy_template.xml in your ORT directory. By default when you run ORTRunbookLauncher.exe or ORTRunbookLauncherCLI.exe the policy_template.xml will be used allowing you to only have settings for one runbook at a time. You can elect to use another file by using the /ORTXML switch. What this does is allows you to store multiple XML templates in the same directory by different names and launch the specific one you want.
The /ORTXML switch only works using ORTRunbookLauncherCLI.exe as it is passed as a parameter. Another way around this if you are stuck on using the GUI component is to create multiple folders and put the exe’s, config file in each folder as it will have its own policy_template.xml file. That however could become a nightmare to manage and requires more space. I recommend using the /ORTXML switch.
Let’s look at the GUI component. In the ORT folder launch ORTRunbookLauncher.exe. The Runbook Launcher window will pop up. It should look similar to the following screenshot.
Input the parameters and click “Start Runbook” button.
It is that easy to remotely launch a runbook using this tool. Using the ORTRunbookLauncherCLI.exe is basically doing the same thing except it is running from a command line allowing you to pass in the values for the parameters right in the command. The syntax for starting a runbook using the ORTRunbookLauncherCLI.exe would look like this:
ORTRunbookLauncherCLI.exe /LastName=Sinatra /Location=”Building 45″ /Department=Sales /Title=”VP of Sales” /FirstName=Frank /SamAccount=Franks /”Reporting To”=”John Adams”
NOTE: If the parameters’ names or values have spaces, you need to enclose them using double quotes.
Ok, so now let’s combine the tool with Service Manager and its CMDB. Think about all the possibilities. There are a lot of useful scenarios in which these two could be utilized. A couple of possibilities I can think of off the top of my head are: Pass a user from Service Managers CMDB to this tool as a parameter and have a runbook disable a user in AD, pick up a computer from the CMDB pass it as a parameter to a runbook and move the computer from one OU to another in AD.
I don’t see this tool as a replacement for using Runbooks with Service Requests in Service Manager. I see this as more of a way to give the administrative team a quick and easy way to launch runbooks without ever leaving the Service Manager console.
Let’s look at how we can bring the Orchestrator Remote Tools and Service Manager together, create a console task and accomplish a task.
For this blog post we are going to use a very simple disable user runbook. To do this we need to create a console task using the ORT tool. Use the following steps to do this:
In the Service Manager console go to \Library\Library\Tasks on the right hand side under Tasks click on Create Task.
On the Create a Task win...