Orchestrator System Center Integrations Part 2 – Creating a computer account in an OU
In part 1 of this Orchestrator System Center Integrations blog, we setup the configuration for the Orchestrator Integration Packs for AD, Configuration Manager, Operation Manager and Virtual Machine Manager. Now, let’s create a simple Runbook to Create a computer account in a specific OU.
Incase you missed it, here is the link for Part 1
All the way at the bottom of Activities you will see Runbook Control, clicking on Runbook Control, you will see Initialize Data. This is basically your input for the Runbook. You can input data into a Runbook from the Runbook Tester, the Web Interface, System Center Service Manager, an HTML page, SharePoint web part, or whatever. I just run the Runbook Tester; it’s a quick and easy what to test a Runbook. All you do is highlight Initialize Data and drag it into your workspace.
Now select the Active Directory Activities. Notice all the Activities you have for AD. We are only interest in the Create Computer account. But as you can see, there is a whole lot more you can do. Drag Create Computer into the workspace.
Now, hover over Initialize Data, until you see the crosshairs. Now, using your mouse, drag a line between Initialize Data and Create Computer.
Next, right click on Create Computer and select Properties. Click the ellipse and select the configuration you want to use. (what you setup earlier). Now all you see is Common Name. So what is the Common Name of your server? How does this tell me what OU? As you see, there are Optional Properties you can set.
So the way Orchestrator works is this thing they call the Databus. Information from the previous object is passed down to the next. So let’s add in some optional properties.
For the Create Computer activity to work properly, we need to add in some Optional Properties. Here we are going to add in Container Distinguished Name, Description, Display Name, DNS Host Name, Location and SAM Account Name. Simply click on the >> to add items from the right to the left. Then select OK.
Once finished, we end up with this
So a lot of this information is the same. But I don’t want to hardcode information in here, I want it to come from my input. So, what I have to do is subscribe to the information. To do that I right click in each line and select Subscribe, Published Data. Published Data would be anything passed down the Databus.
But when I select the drop down for Activity, there is nothing. Well that’s because we don’t have anything in the Published Data Activity.
So lets put some information in the Initialize Data Activity. So really Looking at the Properties for Published Data, what do i need to complete this out? Well, I need a Computer Name, I also need a Description of the Computer. I also need the location.
So lets add the properties into Initialize Data. Right Click on Initialize Data, and select Properties. As you can see, there is nothing in Initialize Data. Now click Add. Click on Parameter 1 and rename to Computer Name or Server Name and select OK.
Now, click on Add again. In rename Parameter 2 to Computer Description and select OK
Lets also add in Computer Location and select Finish.
Okay, now we have information in Initialize Data. Lets go back into the Create Computer Activity and Subscribe to the Published Data from Initialize Data. So for Common Name, what is that? Well it’s the Computer Name. Right Click on Common Name and select the Computer Name from the Initialize Data activity. Highlight Computer Name and select OK.
Do the same thing for Description, Subscribe to Computer Description from Initialize Data.
Display Name is the same as Computer Name. Subscribe to the Computer Name Activity from Initialize Data.
DNS host name is going to be the Computer Name again. For Location, we select the Computer Location Activity from Initialize Data, get the idea?
The Container Distinguished Name is going to be where you want the new Computer to be created. If you do not put anything in here, it will default to Computers in AD. I what all new computers or servers to go into my Servers OU in AD. So, I am going to hard code the Servers Distinguished Name for this one. I input OU=Servers,DC=LAB,DC=Local. That is the distinguished name for the Servers OU.
You can verify by opening up ADSI Edit and selecting the container where you want to create the computer and select Properties. You can even view and copy to the clipboard by selecting the View button in ADSI Edit.
Then finally the SAM account name is going to be the same as Computer Name. Lets select Computer Name from Initialize Data. Afterwards, select Finish.
OK, now lets see if it works. Select Runbook Tester from the menu items.
Then select Run or Step Through. Remember, we are actually running the Runbook. Tester means you are Testing to make sure it works. No simulations here.
So when I select Run, I need to put in the Computer Name, Computer Description, and Computer location. Go ahead and enter in the information.
When I click OK, an new computer account should be created in the Servers OU in AD.
I can see from the Log that everything was successful
Checking AD, we see that our new computer account was created.
So, we now know how to create a simple Runbook. In part 3, we will add on a little more and create a VM with this computer name.