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.
Thank you for the article. I definitely want to figure out how to get this working.
I did want to point out that your command is incorrect in the article, however the screenshot does show you using the right one:
“WMIC csproduct GET model” should be “WMIC csproduct GET name”
Take care!
Thank you so much for that!
I just fixed it. Thanks again.
Thanks for great article. Just wondering – do I need to set up Inject drivers profile selection also in Postinstall TS or default Inject Drivers from Command line (cscript.exe “%SCRIPTROOT%\ZTIdrivers.wsf”) is enough? Thanks
What should the bootstrap and the custom.ini look like
Is your “z” key broken?
I have Dell tablet Venue 10 pro 5055, I’m trying to pxe boot to it with an ethernet usb adapter from startech. I”m able to pxe boot but when I have to type the credentials to pick the task sequences it shows me that Invalid credentials: The network path was not found. I use the same method on a regular PC my credentials work just fine there. I’m wondering what needs to be done in order for me to be able to authenticate from the tablet. By the way the ethenet usb adapter drivers I have injected in Out-of-Box. Please help, I would appreciate your help.
Surely you need to update the deployment share?
Do I need to worry too much about WinPE drivers added to MDT if I’m running a new deployement from within the OS and not using WDS to pxe boot?
I have just left the Windows PE settings alone under my Deployment Share.
I’m deploying my custom Windows 10 image x64, the settings I have are below
https://imgur.com/a/HY1Ngl4
I don’t see where you put the WMIC querry???
all of that is done in cmd (Command prompt)
As a complete MDT newbie. There are some steps missing I couldn’t figure out right now. Where do you get the content for the variables and where do you select the matching folder to copy the drivers?
All drivers are stored in Out Of Box Drivers in MDT, add them there in folders and subfolders based on the results from the commands above
Can I use %vendor% somehow instead of %make%? It would make my setup alot cleaner, easier and more pro looking
I don’t think %vendor% is a built in variable. If you really wanted to use that variable then you’ll have to create it using a “Set Task Sequence Variable” step by assigning the value of %make% to Vendor. You’ll need to make sure this step is run after the initial Gather step (which is when the variables are created).
How would that look like, the code part so to speak?
Drivers are not getting installed. Do I need to keep it after “Install Operating System” section
In the “pre install” section of your task sequence
Also make sure your Task sequence Value matches “out-of-box-drivers” folder
Task Sequence: Windows x64\%Model%
out-of-box-drivers structure: Windows x64\
Still doesn’t work
How’s the layout, provide images.