Creating a Sample Runbook in Orchestrator (SCORCH)
In our previous blog, we have learnt how to deploy Integration Pack in System Center Orchestrator (SCORCH), now it’s time to move a step forward and create/design a Runbook in Orchestrator.
If we talk about Runbook, the power of System Center Orchestrator lies in a Runbook. Runbooks contain the instructions for an automated task or process. The individual steps throughout a runbook are called activities. Within the Runbook, additional controls provide information and instructions to control the sequence of activities in the Runbook. Runbooks, activities, and each runbook control have configurable properties. You modify these properties to configure the behavior that your runbook requires.
So, let’s start with creating a sample Runbook which will create a new user in Active Directory.
1: Open Runbook Designer on the computer where the Runbook Designer is installed.
Make sure you have Active Directory option under Runbook Designer console. If not, you need to deploy Active Directory Integration Pack through Deployment Manager.
2: Click the Active Directory option.
3: Click on Add button.
4: Provide a suitable name to the configuration.
5: Under Type option, click ellipsis (…) button and select Microsoft Active Directory Domain Configuration.
6: Provide Configuration User Name and Password. The ID must have rights to create user in Active Directory.
7: Provide Domain Controller FQDN, in our case is: SCMVPCD.SCMVP.COM
8: Provide Default Parent Container, in our case it’s:
9: Click OK button to continue.
10: Click Finish button to save the configuration.
Now, since we do have the configuration of Active Directory, let’s create the Runbook to create a user.
11: Right Click the Runbooks folder under Connections pane and click Folder option.
12: Provide the Folder a suitable name.
13: Right click the created folder and select Runbook option.
14: In the Runbook Designer Design workspace, right-click the Runbook tab, and then select Rename.
15: Provide a friendly name to your Runbook and press Enter.
16: In the Activities pane, drag the Initialize Data activity from the Runbook Control category to the Design workspace of your Runbook.
17: Double-click the Initialize Data activity to open the Properties dialog box for that activity.
18: Click on Add button under Initialize Data Properties window.
19: Click on Parameter 1 and change the Activity data name to CommonName.
20: Click OK to continue.
21: Same way, create two more parameters FirstName and LastName.
22: Click Finish button to save the details.
23: In the Activities pane, drag the Create User activity from the Active Directory category to the Design workspace of your Runbook.
24: Create smart link between Initialize Data and Create User activities.
25: Double-click the Create User activity to open the Properties dialog box for that activity.
26: Under Name dialog box, click the ellipsis (…) button and select the Active Directory configuration we created (SCMVPAD).
27: Click OK to Continue.
28: Right click the Common Name dialog box and click Published Data under Subscribe option.
29: Select CommonName option and click OK.
Since now we have the Common Name, we need to add the First and Last name properties.
30: Click on Optional Properties button.
31: Select First Name and Last Name from the Available list, click OK.
32: Add the parameters for First Name and Last name the same way we did for Common Name through Initialize Data option under Step 28.
33: Click Finish button to save the configuration.
34: In the Activities pane, drag the Enable User activity from the Active Directory category to the Design workspace of your Runbook.
35: Create smart link between Create User and Enable User activities.
36: Double-click the Enable User activity to open the Properties dialog box for that activity.
37: Under Name dialog box, click the ellipsis (…) button and select the Active Directory configuration we created (SCMVPAD).
38: Right click the Distinguished Name dialog box and click Published Data under Subscribe option.
39: Select Distinguished Name and click OK.
40: Click Finish button to save the configuration.
The Runbook creation is complete now, save the Runbook by clicking Check In button.
Let’s test our Runbook.
1: Click Runbook Tester option and click Yes button if asked to check out the Runbook.
2: Click on Run button and provide the parameters (First Name, Last Name & Common Name).
3: Click OK button to execute the Runbook.
4: The Log should show the success status for your activities.
A user with name Shashi Bhushan should be created by now. Let’s verify the same in Active Directory Users and Computers console.
We can see the new user under TESTOU in console.
The same way you can add other required parameters for the user creation in Runbook.
It was just a basic example of creating a Runbook in Orchestrator, you can build your logic and achieve a lot from this automation tool. You can easily automate your IT Infrastructure environment using power of the available Integration Packs.
Please refer Microsoft TechNet library to gain in-depth knowledge about Runbooks in Orchestrator:
Hope this helps.