Summary

Downloading and deploying drivers in an environment where Windows Update is disabled using pnputil.exe

Issue

Many enterprise environments disable Windows Update and use their own method for deploying software updates (e.g. SCCM). This is usually achieved using a GPO or the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching\SearchOrderConfig

More information on this key can be found in this article: https://forums.guru3d.com/threads/windows-10-registry-tweak-for-disabling-drivers-auto-update-controversy.418033/

This poses an interesting question when it comes to Microsoft driver updates. What do you do when a peripheral device requires a driver update?

One way is to search the Microsoft Update Catalog:
https://www.catalog.update.microsoft.com/

But what happens if you can’t get the driver from MS Update? As an example lets presume a webcam driver is causing issues but the fix is located in a newer version of the driver. Many webcams manufacturers no longer provide driver packs to manually download and deploy. Instead they opt to hardware certify with Microsoft and have the driver added to Windows Update.

A quick google will reveal PowerShell commands such as

Export-WindowsDrivers

More information on this commandlet can be found here: https://docs.microsoft.com/en-us/powershell/module/dism/export-windowsdriver?view=win10-ps

The issue is however that these will only extract third party drivers, not quite what we are looking for.

Resolution

There is a utility built into Windows that was the go-to for printer driver deployments on Windows XP/7 called pnputil

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/pnputil

Our tool of choice today still works on Windows 10 (1803) and is great for extracting drivers from a device.

Pnputil is located in the following directory %windir%\system32\pnputil.exe and follows the syntax:

Extract to current directory:

C:\Windows\System32\pnputil.exe /export-driver <driver>.inf .

Extract to a specified directory (directory must exist):

C:\Windows\System32\pnputil.exe /export-driver <driver>.inf

Implementation

Identifying the driver files

Before extracting the drivers however we need to identify the driver files we need. There are a number of ways to do this such as the below.

Get driver INF file

    1. Open device manager
      1. Right click the Start button
      2. Click Device Manager

Or for more restrictive environments

      1. Open an elevated command prompt
      2. Type devmgmt.msc
    1. Open device properties
      1. Navigate to the device in question
      2. Right click on the device
      3. Click Properties this will bring up the device device properties page
        image
    2. Navigate to Inf name property
      1. Click on the Details tab
      2. Select Inf name from the Properties drop down
        image
    3. Get Inf Name(s) listed

image

Alternatively you can query WMI if a programmatic method is required.

Extract Driver

From a device with a working driver

  1. Open an elevated command prompt
  2. Type the following command to confirm the driver is present:
    C:\Windows\System32\pnputil.exe /enum-drivers | findstr "<name of driver>.inf”

  3. For example:
    C:\Windows\System32\pnputil.exe /enum-drivers | findstr "oem49.inf"image
  4. Type the following to extract the driver
    C:\Windows\System32\pnputil.exe /export-driver <name of driver>.inf .
    For example:

    C:\Windows\System32\pnputil.exe /export-driver oem49.inf .
    As this model of webcam has a Mic built-in, we also need to extract the audio driver
    image

You will find the drivers in the folder you specified

image

Conclusion

These extracted drivers are now ready to deploy using your preferred method.

Manual Install:

Simply right click on the .inf file and click Install on the target machine

image

Pnputil:

Or you can use pnputil itself to install the driver with the following command line:

C:\Windows\System32\pnputil.exe /add-driver "<path to driver>.inf" /install

For example:

C:\Windows\System32\pnputil.exe /add-driver "C:\LogitechDrivers\luvc1564v.inf" /install

For multiple drivers, place all drivers in the same directory and use a wildcard
C:\Windows\System32\pnputil /add-driver <path to driver>\*.inf /install

image

Pnputil Doc:

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/pnputil

Good article showing the basic steps on how to deploy pnputil using SCCM:

https://ccmexec.com/2013/10/update-a-device-driver-configuration-manager-2012/

Advertisements