The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

Using Runbooks as part of a Task Sequence–Part 1

Posted by Mikael Nystrom on November 28, 2012

This is the first post in series of post that will focus on the integration between MDT 2012 Update 1 and System Center 2012 Orchestrator.

The Scenario:

The company ViaMonstra is about to migrate to a new operating system. They will use the refresh scenario, but they would like to avoid doing backup of all computers. Luckily all VIP computers are a member of a global domain group. So what we need is a easy way to check the group membership of the computer. If the computer is a member of the VIP group we will do backup, otherwise we will not.

The Solution:

Create a runbook in Orchestrator that checks membership of the VIP group, add the runbook execution in the correct location in the task sequence, deploy and be happy.

The how to:

The Orchestrator Runbook

This is how the runbook needs to look.

image

The runbook works like this:

We feed the runbook with the name of the computer and the name of the group we would like to check membership of

image

Find the group in Active Directory

image

Check if the computer is a member of that group
(Note: We use the OSDComputername but to check the membership we need to add $ in the end of the variable, since that is the correct name of the computer when we search for the SM account name)

image

If the computer is a member we will return ComputerBackupLocation set to AUTO

image

image

If the computer is not a member of the group we will return ComputerBackupLocation set to NONE

image

image

To configure the return property correct you need to configure return value by adding whatever you would like to return using properties on the runbook it self.

image

The Task Sequence:

In the Task Sequence we will add runbook just before we fire up the backup, like this.

image

As you can see, the runbook will show us the runbook parameters it accept as input and in this case we are smart and use the same property name that are used in the Task Sequence, that is OSDComputerName. but it also need the Property VIPComputerGroup and that property needs to be added to customsettings.ini, like this

image

When running a test task sequence that only contains the runbook and some set parameters you can verify that the runbook works correct and return the correct property. Here is a picture of the bdd.log file where you can see that the when we send in the computername and VIPComputerGroup and we will get ComputerBackupLocation property as AUTO

image

It is pretty smart to create a test sequence that only contains the runbook plus property values you need to verify that it works, to do that just create a custom task sequence that looks like this and then run the sequence using LiteTouch.vbs and check the bdd.log file. Here is how the test task sequence looks like.

image

You can download the runbook, the test task sequence and customsettings ini here

/mike

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: