Thursday, 27 July 2017 13:25

Managing MDT Out-of-the-Box Driver Repository using PowerShell

Written by
Rate this item
(5 votes)


In order to deploy Windows 10 with Microsoft Deployment Toolkit successfully, you need to keep drivers for the actual operating system up to date. In today’s blog I will discuss the approach that I use to import and update Out-Of-Box drivers in Microsoft Deployment Toolkit using PowerShell.

If you are used to designing deployment solutions for big customers, driver management sometimes becomes a very time consuming task. Additionally, in the time where everything happens so rapidly: we are now seeing Windows Insider Preview every other week, we have production releases of Windows 10 twice a year and every now and then there are new hardware models being adding to the lineup. The fast cadence of Windows feature updates means that you need to keep your driver repository up-to-date which can become a daunting and actually a pretty boring task. The good news is that you can simplify your Out-of-Box drivers management by leveraging Microsoft Deployment Toolkit's PowerShell module meaning you can import or update all of the drivers that will be needed into your MDT Deployment Workbench in a fingersnap.

Note: This script follows guidance outlined by Johan Arwidmark for Lite Touch Driver Management.

Assume following folder structure under the Out-of-Box Driver store: a subfolder for each Operating System (including architecture type (x86, x64)) followed by manufacturer and then hardware model as shown below:

  • Windows 10 x64
    • Dell Inc.
      • Latitude 5470
        • audio
        • network
        • storage
        • ...
    • HP
      • Elitebook 840 G3
        • audio
        • network
        • storage
        • ...

This approach greatly simplifies driver management and also helps to avoid potential pitfalls with Plug and Play where a driver that wins the internal ranking process during Light Touch would end up being installed. Johan's post also outlines how to use DriverGroups to enforce driver selection based on the built-in Make and Model variables, so I will not cover this topic here.

Back to the script: as I was designing and testing Windows 10 deployment solutions for a number of enterprise customers, dealing with drivers quickly became very mundane and I started tinkering around with the MDT's PowerShell module. The key benefit from using a script is that once you have the automation ready, it’s easy to add updated drivers for existing models, and easy to add new models to the Deployment Workbench.

How does it work:

The entire approach is highly streamlined:

  1. Download current driver packages:
  2. Create the driver source structure in the file system. The key to successful management of drivers for MDT 2013 Update 2, as well as for any other deployment solution, is to have a really good driver repository. From this repository, MDT-ImportDrivers.ps1 PowerShell script imports drivers into MDT for deployment, but you should always maintain the repository for future use.
    • Dell Inc.
      • %Model% (for example Latitude 5470)
    • HP
      • %Model% (for example Elitebook 840 G3)
    • Hewlett-Packard
      • %Model% (for example Elitebook 840 G1)
    The preceding folder names are selected because they match the actual make and model values that MDT reads from the machines during deployment. You can find out the model values for your machines via the following command in Windows PowerShell:
    Get-WmiObject -Class:Win32_ComputerSystem
    Or, you can use this command in a normal command prompt:
    wmic csproduct get name

    Note: On Lenovo machines WMI query reports back a cryptic model string. This is explained further by Mikael Nyström in the following blog post which also has a recommended solution for dealing with this inconvenience.

  3. Open MDT-ImportDrivers.ps1 PowerShell script as administrator. Adjust following variables to match your environment:
    # Adjust these variables if necessary 
    $stage_dir = "C:\Import\DRIVERS\"
    $mdt_root = "\\MDT01\W10$" #UNC or local
    $vendors = @("HP", "Dell Inc.")
    $os_name = "Windows 10 x64"
  4. Run the script. It will parse the driver repository folder and will mimic the driver structure of your driver source repository in the Deployment Workbench. This is done by creating logical folders in the Deployment Workbench.

    Note: If any folder exists, MDT-ImportDrivers.ps1 script will remove and then recreate it – deleting any driver references in the process - in order to ensure that only most recent drivers are included in the deployment share.

Note: This is just one approach how to automate Out-of-Box Driver Management - there is the fantastic Driver Automation Tool  by Maurice Daly - but this is the approach that works best for me and maybe you will find it helpful as well.

Download MDT-ImportDrivers.ps1

Read 63098 times Last modified on Friday, 28 July 2017 16:26

Recent Posts

  • Windows 10 21H2 Built-In Apps: What to Keep
    The development of the Windows 10, version 21H2 is finished and the update will soon be available for download from…
    Written on Wednesday, 20 October 2021 11:41
  • Group Policy Changes in Windows 10 21H2
    As Windows 10, version 21H2 update development winds down, Microsoft is now preparing for the final release of the Windows…
    Written on Wednesday, 20 October 2021 07:20
  • Group Policy Changes in Windows 10 20H1 Preview
    As Windows 10 Vibranium Update (20H1) development winds down, Microsoft is now beginning the phase of checking in the final…
    Written on Tuesday, 14 January 2020 04:51
  • An alternative ESU MAK Activation Solution
    This blog post was shared with me by a colleague of mine, Daniel Dorner, a Microsoft Premier Field Engineer. It’s…
    Written on Wednesday, 04 December 2019 21:04
  • The Case of Missing UE-V Templates
    My customers often deal with unexpected Windows behavior and this case is no different. This particular one is especially interesting…
    Written on Tuesday, 03 September 2019 12:20
  • The Case of Changing Default Printer
    While I sometimes long for the day when I no longer have to deal with unexpected Windows 10 behavior, there’s…
    Written on Wednesday, 14 August 2019 20:36