Install drivers by computer model using WMI query during SCCM OSD Task Sequence

Apply the right driver package per hardware model in a ConfigMgr OSD task sequence using WMI query conditions, including Lenovo, VMs and how to check it worked.

Install drivers by computer model using WMI query during SCCM OSD Task Sequence

If you deploy Windows with Configuration Manager to more than one hardware model, every machine needs the right drivers and nothing else. The simplest reliable way to do that in an OSD task sequence is one Apply Driver Package step per model, each with a WMI query condition so it only runs on the hardware it was built for. This guide covers how to find the model string, how to write the query, how to deal with the vendors that do things differently, and how to check it worked.

The method has not changed in years and still works on current branch ConfigMgr with Windows 11 images. It is also the base that most “modern driver management” scripts build on, so it is worth understanding even if you later automate it.

Why use a WMI condition instead of Auto Apply Drivers

The Auto Apply Drivers step matches drivers by Plug and Play ID against the whole driver catalogue. That sounds convenient, but it often pulls in a driver meant for a different model that happens to share a hardware ID, and it can be slow with a large catalogue. A driver package per model, filtered by WMI, gives you:

  • exactly the driver set the vendor tested for that model
  • faster deployments, because only one package downloads
  • predictable results you can troubleshoot from the logs

What you need first

  • Driver packs for each model, downloaded from the vendor (Dell, HP and Lenovo all publish SCCM driver packs for current models). If you work with HP, our guide to finding current HP driver packs for SCCM and Intune walks through it.
  • The drivers imported into Software Library > Operating Systems > Drivers and placed into a driver package per model and architecture, distributed to your distribution points.
  • The exact WMI model string for each machine.

Finding the model name

On a machine of the model you want to target, open PowerShell and run:

Get-CimInstance Win32_ComputerSystem | Select-Object Manufacturer, Model
Get-CimInstance Win32_ComputerSystemProduct | Select-Object Vendor, Name, Version

From a command prompt the older wmic computersystem get model still works on some builds, but WMIC is deprecated and removed by default on recent Windows 11 releases, so use PowerShell. If you would rather click than type, our free tool does the same job and builds the query for you:

Download Get WMI Query

You can also pull every model in your estate from the site database. Our SQL query to count computers by model lists the strings exactly as hardware inventory recorded them, which saves visiting each machine.

Adding the condition to the task sequence

  1. Edit your task sequence and, after the Apply Operating System step, add a group called something like Drivers.
  2. Inside it, add one Apply Driver Package step per model and point each at the matching driver package. Name each step after the model so the log is readable.
  3. On each step, open the Options tab, click Add Condition and choose Query WMI.
  4. Leave the namespace as root\cimv2 and enter the query for that model, for example:
SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "%Latitude 5550%"
WMI Query Properties dialog with the Model LIKE query entered
Task sequence step condition configured with the WMI query

The % signs are wildcards, so the query matches even if the vendor adds extra text around the model name. Keep the double quotes around the value. A missing quote or wildcard is the most common reason a step is skipped when it should run. Use the Test Query button in the dialog on a matching machine if you can, which tells you straight away whether the syntax is right.

Be careful with wildcards on model families. %Latitude 5550% is fine, but %Latitude 55% would also match a 5540 and apply the wrong drivers. Make the string as specific as it needs to be.

Lenovo and other exceptions

Lenovo stores a machine type code such as 21KC in Win32_ComputerSystem.Model and the friendly name in Win32_ComputerSystemProduct.Version. You can target either. The machine type is more precise because one friendly name can cover several types:

SELECT * FROM Win32_ComputerSystem WHERE Model LIKE "21KC%"
SELECT * FROM Win32_ComputerSystemProduct WHERE Version LIKE "%ThinkPad T14 Gen 5%"

For virtual machines, skip driver packages entirely or add one for your hypervisor. Hyper-V reports the model as Virtual Machine and VMware as VMware Virtual Platform or VMware7,1, so a condition on those lets you handle them separately.

Handling x64 and ARM

Almost every Windows 11 deployment is 64-bit, so the old need for separate x86 and x64 driver packages has largely gone. If you have Arm64 devices such as Snapdragon laptops, keep their drivers in their own package and condition on the model as normal. Driver packages are tied to one architecture and applying the wrong one simply fails.

Checking it worked

Open smsts.log after a test build. Each step that was skipped logs that its condition evaluated to false, and the matching step logs the driver package download and DISM injection. If no step ran, compare the model string in the log with your query. Our guide to reading smsts.log shows where to look, and Device Manager on the finished machine should show no unknown devices.

FAQ

Can I put the condition on a group instead of each step?
Yes. Some admins create a group per model with the WMI condition and put the driver step plus any model-specific BIOS or firmware steps inside it. That keeps everything for one model together.

Does this work with Windows 11 24H2 and 25H2?
Yes. The WMI classes and the Apply Driver Package step are unchanged. Just make sure the driver packs you import are the vendor’s Windows 11 versions.

What if I have dozens of models?
The list of steps gets long. At that point many people move to a scripted approach that reads the model at runtime and downloads the matching package, but the WMI query is still what identifies the model underneath.

If you get stuck, leave a comment below and we will try to help.

🛠️

Gear We Recommend

Testing configs is easier with a dedicated admin machine set up right. Here’s the kit we use.

Browse our Windows Admin Toolkit picks on Amazon

As an Amazon Associate, TechyGeeksHome earns from qualifying purchases.

Next step

Free toolWMI Rebuilder Fix


Discover more from TechyGeeksHome

Subscribe to get the latest posts sent to your email.

Andrew Armstrong

Andrew Armstrong is a UK-based IT professional with 26+ years of hands-on experience in Windows, Windows Server, SCCM/ConfigMgr, Intune, Active Directory, PowerShell and enterprise infrastructure.

He founded TechyGeeksHome in 2010 and has published 770+ practical guides to real-world IT problems. He also builds free Windows utilities, including Ultimate Settings Panel, which has been downloaded over 850,000 times.

One thought on “Install drivers by computer model using WMI query during SCCM OSD Task Sequence”

Comments are closed.

Part of The Geek Network