Multiple conditions can be grouped using IF statements to create complex conditions. For instance, imagine that a particular step should only be executed for Contoso 1950 computers running Windows Server 2003 or Windows Server 2008. Written as a programmatic IF statement, it would look similar to the following:

IF ((Computer Model IS “Contoso 1950”) AND (operating system=2003 OR operating system=2008))

To add a complex condition

1.   In the Configuration Manager console or in the Deployment Workbench, in the task sequence editor, edit task_sequence (where task sequence is the task sequence that will upgrade the servers).

2.   Click the task sequence step to which to add the condition, and then click the Options tab.

3.   Click Add condition, click If Statement, and then click All conditions. Click OK.

4.   Click the condition statement, click Add condition, and then click WMI Query.

5.   Ensure root\cimv2 is specified as the WMI namespace, and then, in the WQL Query box, type SELECT * FROM Win32_ComputerSystem WHERE ComputerModel LIKE “%Contoso%1950%”. Click OK.

6.   Click the IF statement, and then click Add condition. Click If statement, and then click Any condition. Click OK.

7.   Click the second IF statement. Click Add condition, and then click Operating System Version.

8.   In the Architecture box, click the architecture for the servers. For this example, click x86.

9.   In the Operating system box, click the operating system and version. For this example, click x86 Windows 2003 original release. Click OK.

10. Click the second IF statement. Click Add condition, and then click Operating System Version.

11. In the Architecture box, click the architecture for the servers. For this example, click x86.

12. In the Operating system box, click the operating system and version. For this example, click x86 Windows 2008 original release. Click OK.


Related Topics

Configuring Conditional Task Sequence Steps