MDT 2010: Creating Task Sequence Step Conditions with Using WMI Queries

This is the last in a series of articles about Task Sequence Step Conditions. For those not frighted away by the title, I’ve simplified it as much as I can.. We’re going to use the WMI Query Language (WQL) to make our Task Sequence Step query based conditions as opposed to just using simple variables.

You may need to use this technique when you come across a situation where MDT does not have a suitable variable(very rare). For this I’ve concocted an issue to tackle.

Now, to begin with we need to look at an example of a WQL query statement. In the MDT documentation this is a WQL example showing the correct syntax.

Select * From Win32_ComputerSystem WHERE Model LIKE "%Dell%%1950%"

There’s an old Microsoft tool to create WQL code called the WMI Code Creator v1.0 and there’s a WQL reference on MSDN. With these resources you should have no problems creating WMI code.

Now, back to the problem. The scenario is you want to install DVD writing software but only on machines that have DVD Writers installed. You have a task sequence step that installs the software and but you want to add a condition to it.

As for the solution, This example shows how to use the WMI Code Creator tool to generate the WQL statement.

  1. Select the Win32 class.
  2. Select the desired property.
  3. Select a value to isolate the query.
  4. Copy the query statement.

Next, in MDT open the Task Sequence and edit the Task Sequence Step. On the Options tab select Query WMI.

Paste in your query statement and click OK.

This step will now only run on computers with DVD writers installed.

Additional resources:
WQL Operators
Win32_CDROMDrive Class
Technet Script Repository

Advertisements

About Andrew Barnes

A Scripting and Deployment Specialist.
This entry was posted in Deployment, MDT 2010 and tagged , . Bookmark the permalink.

One Response to MDT 2010: Creating Task Sequence Step Conditions with Using WMI Queries

  1. theNugget2010 says:

    I have done some WMI before in Task Sequences but always useful to know that there is the WMI Code Creator to assist checking the information.

    Like

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