One of the first thing I learnt when I started getting into Windows deployment was that Microsoft and, more importantly, the industry in general encourages the development of one master image and using a tool such as the Microsoft Deployment Toolkit to inject the right drivers based on the computer model at deploy time. I was curious to see how it works in practice since my workplace had a different image for every computer model within the organisation.
There are two ways to get this done – using Selection Profiles and using a custom Task Sequence Variable. I chose the latter which I understand is the right way to go about it.
In a nutshell, the custom Task Sequence Variable step runs a WMIC query to determine the make and model of the target computer at deploy time and look for drivers in the right subdirectory within the Out-Of-Box Drivers folder. It’s important that the names of the subdirectories must be exactly the same as the make and model returned from the WMIC query.
Here’s how this is set up in my Lab which will work for both MDT 2010 and MDT 2012.
The Out-of-Box Drivers Folder
First things first, here’s how my Out-of-Box Drivers folder is organised within the Deployment Workbench
You will notice that I’ve organised my folders by Windows version and architecture, followed by make and model. You must run a WMIC query on your target computer to determine the make and model of the computer and make sure you spell the make and model exactly the same in your Out-of-Box Drivers subdirectories as the values returned from the query.
The folder name for the computer manufacturer (e.g. Windows 7 x64\Hewlett-Packard) must match the value returned from running a WMIC query on the target computer
WMIC csproduct GET vendor
Similarly, the computer model (e.g. Windows 7 x64\Hewlett-Packard\HP Compaq dc5800 Small Form Factor) must match the value returned from the query too
WMIC csproduct GET name
The Delploy Task Sequence
On my deploy Task Sequence I added a custom Task Sequence Variable above the Inject Drivers step in the Preinstall stage as follows:
The important thing to notice here is the value field.
The %make% and %model% variables will be determined at deploy time when a WMIC query is run to determine the manufacturer and model of the target computer. It is for this reason the folder names in the Out-of-Box Drivers folders must match the value returned from the WMIC query on your target computer otherwise injecting the drivers will fail.
Finally, in the Inject Drivers step just below our custom Drivers Path step we created earlier, select “Nothing” under “Choose a selection profile”.
That’s it. As long as you get the computer manufacturer and model exactly right everything should work perfectly.