A new feature of Configuration Manager 2007 R2 is the ability to define a Task Sequence Variable on a Collection or individual resource without a value. Then when the Task Sequence initiates on a system, a dialog box is presented where you can set the value of the variable.
A quick example is in order to demonstrate this:
- Create a TS. Use the intended variable in a conditional or in any other way that variables can be used. For this example, I simply set a condition on the install of XML Notepad: it will only be installed if the TS variable InstallXMLNotepad is set to Yes.
The Task Execution Condition
- Advertise it to a collection.
- Set the InstallXMLNotepad variable on the targeted collection but do not defined a value; i.e., leave it blank. To set a variable on a collection, right-click it and choose Modify Collection Settings. The second tab, named Collection Variables, allows you to manage the variables for the collection.
Double-click on the variable whose value you want to set (if you have more than one variable with a blank value, they will all be shown in the list box).
That’s it. The variable is now set and will be used in the conditional we set in step 1. The major shortcoming is in plain user friendliness: the raw variable name is presented to the user without any type of prompt and you cannot constrain or validate the value entered in any way. But, if your process is well defined and documented, these shortcomings are relatively small.