Using conditions within task sequences

Although I use MDT integrated with OSD to target software and settings to machines that use a specific default gateway, it is slightly limited if, for example, I want a rule based on location and model or some other custom WMI query.

Instead, I can do this in a task sequence by simply creating a condition, on either a group or a step, ensuring the “if” statement is set correctly to either “All conditions” or “Any conditions”. See below for a selection of conditions I have used:

  1. To query for machines on a specific AD site, create a Query WMI condition and use this query: SELECT ClientSiteName FROM Win32_NTDomain WHERE Description = ‘DomainHere’ AND ClientSiteName = ‘AdSiteNameHere’
  2. 

  3. To query for machines that are specific a computer model, create a Query WMI condition and use this query: SELECT Model from Win32_ComputerSystem WHERE model = ‘Precision M2400’
  4. To query for machines that maybe multiple computer manufacturers, create multiple Query WMI conditions as below:
  5. To stop anyone running a TS when not in WinPE (useful if you want to advertise a TS to all machines but only want them to be used once PXE booted), create a condition based on a TS variable as below:

I can now very quickly and easily target machines based on any WMI query I want.

If I think of any other conditions I use, I’ll add to this post.

Advertisements

2 Responses to Using conditions within task sequences

  1. Lucy Butler says:

    Hello,

    I have a machine that comes with 2 different video cards. I am trying to create a condition in my task sequence that verifies the video card and then installs the right driver. Do you have any idea how to do that? I have been trying to do that without sucess. Any help will be very appreciated.
    Respectfully,

    Lucy 🙂

    • nivor says:

      Hi Lucy,

      Ok well you’ll either need to use the apply driver task sequence steps or if you have the driver as a normal software install package, use the software install step.

      You’ll then need to create an “if” statement on the step and create a Query WMI condition to use one of these queries:

      select caption from Win32_DisplayControllerConfiguration where caption = “GraphicsCardName”

      or

      select caption from Win32_VideoController where caption = “GraphicsCardName”

      For example, for my laptop i’d have to use:

      select caption from Win32_VideoController where caption = “Mobile Intel(R) 4 Series Express Chipset Family”

      If you want to confirm the exact string to use for your graphics card, download and run WMI Explorer (http://www.hostmonitor.biz/download/wmiexplorer.zip), hit the “Query” tab and run the following query:

      select caption from Win32_DisplayControllerConfiguration

      or

      select caption from Win32_VideoController

      If you have any issues please let me know

      Cheers
      Nik

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: