Throughout the years, driver management for operating system deployment in ConfigMgr have been a daunting task that administrators have had to deal with on a regular basis. New computer models are occasionally introduced in the environment, which we can’t deny.
Administrators have previously been manually downloading all required drivers, importing them into ConfigMgr, distributing them to Distribution Points and updating task sequences to include the new driver package for the new computer model. This process can be really time consuming and error prone. In the past, great guys like Johan Arwidmark has come up with great solutions like “Total Control” when it comes to driver management. Recently, Kim Oppalfens posted an article of how to enhance the previous known methods by leveraging the undocumented task sequence variable called OSDDownloadDownloadPackages.
In this post, we intend to cover an automated driver management process that provides a whole new dynamic process upon the idea from Kim Oppalfens, but leveraging both our ConfigMgr Web Service and the Driver Download Tool. This process consists of a set of steps that has significantly been improved and automated to provide an end to end solution for driver management. We want to thank Mattias Benninge for coming up with the idea of using the ConfigMgr WebService in this solution.
Solutions mentioned in this post are not all brand new, however the final piece of the puzzle, allowing for an automated and dynamic way to select the proper driver package for a specific computer model ties it all together in a single script.
We call this modern driver management (not to be confused with MDM, mobile device management), not because it’s driven by the cloud (however some parts could probably be), but it combines new methods for driver management that has not been shown before. What this solution does, simply put, is to automate the download of driver package, creating packages in ConfigMgr, content distribution, dynamic driver package selection during operating system deployment and finally installation of drivers contained in the selected package. All this with only a few clicks in the Driver Download Tool, the ConfigMgr WebService and three simple steps in your task sequence.
Below are the required steps that you need to take in order to leverage this automated solution for driver management.
Step 1 – Download and prepare driver packages
For our this approach to modern driver management we need to populate ConfigMgr with driver packages for your client machines. If you are running Dell, HP or Lenovo hardware then you can use our Driver Automation Tool to do exactly that. Simply download the script from the following link (note that the minimum required version is 2.7 due to changes in the handling of packages):
- Launch the Driver Tool and connect the GUI to your ConfigMgr environment by entering the name of your Site Server and hitting the Connect To SCCM button
- We now need to select the Deployment Platform as “SCCM – Standard Pkg“, then pick “Drivers” as the Download Type and pick your OS/Architecture
- On the Manufacturer Tab select the vendors you wish to display models for and then hit the “Find Models” button
- Select the models from the list you wish to download packages for and hit the “Add to Import List” button
- On the Driver Storage Locations tab enter in UNC paths for the Repository and Package paths
- Click on the Start Download and Import Process to kick off the driver downloads
Once downloaded you should end up with something like this in your ConfigMgr console:
Distribute the driver packages to your DP’s as needed and you are now set for Step 2.
Note: If you wish to download your own driver packages then all you need to do is ensure your driver package name starts with “Drivers -” and you use the WMI manufacturer name for the manufacturer.
Note: If you are already using the Download Tool 2.6 or lower and Standard Packages for drivers, you will need to prefix the package names with “Drivers -” also.
Step 2 – Install ConfigMgr WebService
Modern driver management solution requires the ConfigMgr WebService to be installed in your environment, with the minimum of version 1.2.1. Detailed installation steps can be found in the documentation included in the package, downloadable from the following link:
Before we release version 1.3.0 of the web service, you’re required to patch (simply just replace the ConfigMgrWebService.dll file) from version 1.2.0 to version 1.2.1. Download version 1.2.1 from below:
ConfigMgr WebService 1.2.1 (975 downloads)
The web service is a key function to this process as it will be used during the task sequence to query the available packages from ConfigMgr (using the GetCMPackage function) and through logic in a PowerShell script, match available driver packages to the model and manufacturer of the machine being deployed.
Step 3 – Prepare Task Sequence with dynamic selection
Adding the steps for Modern Driver Management could not be simpler. Download the script required from the following link:
Update 2017-05-04 – Script has been updated with new functionality supporting multiple operating systems packages in addition to some small fixes. See script version history for more details.
This script will automatically detect the computer model and manufacturer, calling the ConfigMgr WebService for driver packages (read legacy Packages, not Driver Packages) matching those values. In the case of multiple packages that match the criteria, the most current package will be selected based upon the SourceDate property of the package object. If there’s no matches at all, the script will exit with a return code of 1, causing the deployment to fail. In terms of logging, the script is writing to a separate log file called DriverPackageDownload.log located in the same directory as the smsts.log file at the time of operation.
Follow this four step process to implement the script referenced above:
- Package the “Invoke-CMDownloadDriverPackage” PowerShell script and distribute it
- Add a Run PowerShell Script command after the Apply Operating System phase, calling the “Invoke-CMDownloadDriverPackage.ps1” script with parameters for the following:
- URI – URL of the ConfigMgrWeb service – example: http://configmgr01.scconfigmgr.com/ConfigMgrWebService/ConfigMgr.asmx”
- SecretKey – The secret key used to connect to the ConfigMgrWebService site
- Filter – In this instance enter the term “Drivers”
- The next step is to add a Download Package Content step. We recommend that you select a small package here, a determined value contained within the OSDDownloadDownloadPackages hidden task sequence variable is used to add the Driver Package to this list. The package selected here in the UI can be considered a dummy package, and will not be downloaded.Use the following Custom Path : %_SMSTSMDataPath%\Drivers
Save the path variable as : DriverPackage
- The final step is to use DISM to apply the downloaded driversEnter the following into the command line : DISM.exe /Image:%osdisk%\ /Add-Driver /Driver:%DriverPackage01%\ /Recurse
See Modern Driver Management in action
Below is a capture of the Modern Driver Management process running on a Dell Latitude E5470:
The real “secret sauce” to our approach to Modern Driver Management is the ability to automate the download and packaging process via our Driver Download Tool and query ConfigMgr during the task sequence using our ConfigMgr WebService. Working hand in hand with each other we’re sure you will agree that this process really takes a lot of the pain out of driver management in ConfigMgr, leaving you free to drink some more coffee.
In testing we have used Dell hardware, however the same logic should work with HP and Lenovo as the driver packages are already catered for here. That’s it for now… and if you have feedback we would be glad to hear it!
Nickolaj Andersen & Maurice Daly
Principal Consultant and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Currently working for TrueSec as a Principal Consultant. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences and user groups.