Windows 7 / Getting Started

Task Sequence Variables

Task sequence variables allow you to compare a variable to a static value using a variety of conditions, such as equal, greater than, and less than. The Task Sequencer maintains numerous variables that you can use in these tests. For example, the Task Sequencer defines a variable called DeploymentMethod that indicates the method of deployment. One possible value of DeploymentMethod is UNC. For a complete list of variables that the Task Sequencer maintains, see the Microsoft Deployment Toolkit Reference in the MDT 2010 documentation.

To add a variable to an item's Conditions list, perform the following steps:

  1. On the Options tab, click Add and then click Task Sequence Variable to display the Task Sequence Variable Condition dialog box.
  2. In the Variable box, type the name of the variable you want to test.
  3. From the Conditions list, choose one of the following conditions:
    • Exists
    • Equals
    • Not equals
    • Greater than
    • Greater than or equals
    • Less than
    • Less than or equals
  4. In the Value box, type the static value you want to compare to the variable using the condition specified in the previous step.

if Statements

Use if statements to combine variables into bigger expressions. For example, create an if statement that evaluates to true only if all the conditions it contains are true (the same as a logical AND), or create an if statement that evaluates to true if any of the conditions it contains are true (the same as a logical OR).

To add an if statement to an item's Conditions list, perform the following steps:

  1. On the Options tab, click Add and then click If Statement to display the If Statement Properties dialog box.
  2. In the If Statement Properties dialog box, choose one of the following options and then click OK:
    • All conditions (AND)
    • Any conditions (OR)
    • None
  3. From the Conditions list, select the if statement added in the previous step and then add task sequence variables to it as described in the previous section.

If you choose All Conditions, all variables added must evaluate to true for the group or step to run. If you choose Any Conditions, the group or task will run if any one of the variables added evaluates to true.

Note You can nest if statements to create complex logic. If you are familiar with Boolean logic, represent Boolean expressions as if statements in the Conditions list.

[Previous] [Contents] [Next]