Modern Driver Management

Modern Driver Management (not to be confused with MDM, mobile device management) combines new methods for driver management by extending the native capabilities of ConfigMgr. What this solution does, simply put, is to automate the download of driver packages from public system manufacturer web sites, creating packages in ConfigMgr, content distribution, dynamic driver package selection during operating system deployment and finally installation of drivers contained in the automatically detected package. All this with only a few clicks in the Driver Automation Tool (which can be set to run on a schedule), the ConfigMgr WebService and two simple steps in your task sequence. Below are the required components that you would need in your environment in order to leverage this automated solution for driver management.

Driver Automation Tool

 

The Driver Automation Tool is a PowerShell GUI which automates the process of downloading, extracting, importing and distributing driver and BIOS packages. At present support is provided for Dell, Lenovo, HP and Microsoft client systems.

5.0.1

(2017-20-10) Additional tab and import function to allow for adding unsupported Makes & Models into ConfigMgr and MDT.

ConfigMgr packages can be used with the MDM solution for dynamic deployment.

Minor fixes & added support for Windows 10 1709

5.0.0

(2017-06-09) Redesigned user interface.

ConfigMgr - Added pilot option for new packages.  Added driver state management for production, pilot & retirement You can move packages between each state within the tool

MDT - Added ability to specify alternative MDT PS module location Added ability to select one or mode MDT deployment shares

4.2.1

(2017-09-15) - Acer support has been deprecated. Added additional output for downloads and conditional checks for  downloads.

4.2.0

(2017-09-09) - Updated GUI. Improved proxy server validation. Proxy server settings apply to all web retrieval methods. Fixed Acer link bug. Minor code clean up.

4.1.3

(2017-08-31) - Added HP BIOS download/packaging support Added SystemSKU details in the package descriptions for updates to Modern Driver / BIOS Management.

4.1.1

(2017-08-25) - Added checks for MDT environment and allowed for non domain accounts to set the scheduled task  where this is detected. Added Microsoft Surface WMI entries in the package description.

4.1.0

(2017-08-08) - Added the option to run silently / scheduled with the Run-DriverAutomationToolSVC.ps1 script. Updated Microsoft Surface extraction process to only copy the Driver and Firmware folders.

4.0.9

(2017-07-25) - Added full Lenovo model type listing into the BIOS description and the release date. This will  be used to more accurately match BIOS updates using the SCConfigMgr web service.

4.0.8

(2017-07-21) - Lenovo related updates including models now showing the full model name i.e. ThinkCentre M800zLenovo model WMI query from ConfigMgr will now match against the model lists by comparing the  model code against the model name in the XML, then populate known models in the selected models list box.

4.0.6

(2017-07-17) - Dell BIOS download bug fix. Updates to the XML now have models sharing the bios listed with / separators. Added a condition to check that and also to report if no matching bios was found.

4.0.5

(2017-07-15) - HP XML changes resulted in duplicate models being displayed and multiple matching URLs  for downloads. These issues have now been resolved. Lenovo FindDriver function re-written to use raw content and regex to find the driver,  this appears to be more stable than the previous Lenovo supplied function.

4.0.4

(2017-07-13) - MDT Import Bug Fix. When importing drivers into MDT as a background process I have observed instances whereby drivers are silently skipped. This does not occur when the Import-MDTDriver process runs in the foreground, so I have moved this process to the  foreground and added an entry to the log window.

4.0.3

(2017-07-12) - Dell BIOS download bug. Revised model matching based on the base number and then  cross referencing the supported models for each match for improved model matching.

4.0.2

(2017-07-11) - Added manufacturer selection export/import settings. The tool will now connect to the ConfigMgr environment automatically if the site code is present in the DATSettings.XML

4.0.1

(2017-07-11) - Bug corrected for Dell models with AIO variants resulting in the base model picking up the AIO BIOS package.

4.0.0

(2017-07-10) - Added functions to allow the tool to remember previously set values. The values are stored in a DATSettings.xml file after the initial first time use.

3.9

(2017-06-09) - Script XML use optimisations. Lenovo BIOS extract and packaging. Minor bug fixes.

  • Queries XML content from Dell, Lenovo, HP and Microsoft
  • Provides Driver downloads for all five manufacturers
  • Provides BIOS downloads for Dell, Lenovo or HP systems
  • Create a BIOS update package
  • Download driver package file for each model
  • Extract the drivers contained within
  • Import the extracted drivers
  • Create a category based on the machine model
  • Create a Driver Package based on the machine make, model and version of the extracted drivers
  • Import the associated drivers into the newly created driver package.  Options allow for either a standard program package or driver package to suit your deployment method 

ConfigMgr WebService

 

The ConfigMgr WebService has been designed to extend the functionality of Operating System Deployment with Configuration Manager Current Branch.

1.4.0
General improvements:
  • Wizard driven installation now stores configuration in registry for improved upgrade experience
  • Wizard driven installation now creates the ConfigMgr WebService Activity event log
  • Added a method to retrieve the current version of the web service
Configuration Manager
  • GetCMApplicationByCategory
  • GetCMUser
  • GetCMOSImageArchitectureForTaskSequence
Active Directory
  • SetADComputerManagedByAttribute
1.3.0
General improvements
  • Addded Description property to GetCMPackage
  • Updated Connect (SMS Provider) method with better event logging
  • Added event logging for start and end of all web methods including client IP address
Configuration Manager
  • AddCMComputerAssociationForUser
  • GetCMCollectionsForDeviceByUUID
  • GetCMOSImageVersionForTaskSequence
  • RemoveCMComputerAssociation
  • RemoveCMDeviceFromCollection
  • RemoveCMLastPXEAdvertisementForDevice
  • RemoveCMLastPXEAdvertisementForCollection
Active Directory
  • GetADSiteNameByIPAddress
1.2.0
Configuration Manager
  • GetCMUnknownDeviceByUUID
  • RemoveCMUnknownDeviceByUUID
Active Directory
  • AddADComputerToGroup
  • RemoveADComputerFromGroup
  • SetADComputerDescription
  • SetADOrganizationalUnitForComputer
1.1.0
CONFIGURATION MANAGER
  • AddCMComputerToCollection
  • GetCMDeviceCollections
  • GetCMDeviceNameByUUID
  • GetCMDeviceResourceIDByMACAddress
  • GetCMDeviceResourceIDByUUID
  • GetCMDiscoveredUsers
  • GetCMDriverPackageByModel
  • GetCMHiddenTaskSequenceDeployments (updated)
  • GetCMHiddenTaskSequenceDeploymentsByResourceId
  • GetCMPackage
  • GetCMUniqueUserName
  • ImportCMComputerByMacAddress
  • ImportCMComputerByUUID
  • UpdateCMCollectionMembership
MICROSOFT DEPLOYMENT TOOLKIT
  • AddMDTRoleMember
  • AddMDTRoleMemberByAssetTag
  • AddMDTRoleMemberByMacAddress
  • AddMDTRoleMemberBySerialNumber
  • AddMDTRoleMemberByUUID
  • GetMDTComputerByAssetTag
  • GetMDTComputerByMacAddress
  • GetMDTComputerBySerialNumber
  • GetMDTComputerByUUID
  • GetMDTComputerNameByIdentity
  • GetMDTComputerRoleMembership
  • GetMDTDetailedComputerRoleMembership
  • GetMDTRoles
  • RemoveMDTComputerFromRoles
1.0.0
Configuration Manager
  • Get Primary User by Device
  • Get Primary Device by User
  • Get Boot Image Source Version
  • Get Deployed Applications by User
  • Get Deployed Applications by Device
  • Get Hidden Task Sequence Deployments

General
  • GetWebServiceVersion
Configuration Manager
  • AddCMComputerAssociationForUser
  • AddCMComputerToCollection
  • GetCMApplicationByCategory
  • GetCMCollectionsForDeviceByUUID
  • GetCMBootImageSourceVersion
  • GetCMDeployedApplicationsByDevice
  • GetCMDeployedApplicationsByUser
  • GetCMDeviceCollections
  • GetCMDeviceNameByUUID
  • GetCMDeviceResourceIDByMACAddress
  • GetCMDeviceResourceIDByUUID
  • GetCMDiscoveredUsers
  • GetCMDriverPackageByModel
  • GetCMHiddenTaskSequenceDeployments
  • GetCMHiddenTaskSequenceDeploymentsByResourceId
  • GetCMOSImageArchitectureForTaskSequence
  • GetCMOSImageVersionForTaskSequence
  • GetCMPackage
  • GetCMPrimaryDeviceByUser
  • GetCMPrimaryUserByDevice
  • GetCMUniqueUserName
  • GetCMUnknownDeviceByUUID
  • GetCMUser
  • ImportCMComputerByMacAddress
  • ImportCMComputerByUUID
  • RemoveCMComputerAssociation
  • RemoveCMDeviceFromCollection
  • RemoveCMLastPXEAdvertisementsForDevice
  • RemoveCMLastPXEAdvertisementForCollection
  • RemoveCMUnknownDeviceByUUID
  • UpdateCMCollectionMembership
Microsoft Deployment Toolkit
  • AddMDTRoleMember
  • AddMDTRoleMemberByAssetTag
  • AddMDTRoleMemberByMacAddress
  • AddMDTRoleMemberBySerialNumber
  • AddMDTRoleMemberByUUID
  • GetMDTComputerByAssetTag
  • GetMDTComputerByMacAddress
  • GetMDTComputerBySerialNumber
  • GetMDTComputerByUUID
  • GetMDTComputerNameByIdentity
  • GetMDTComputerRoleMembership
  • GetMDTDetailedComputerRoleMembership
  • GetMDTRoles
  • RemoveMDTComputerFromRoles
Active Directory
  • AddADComputerToGroup
  • GetADSiteNameByIPAddress
  • RemoveADComputerFromGroup
  • SetADComputerDescription
  • SetADComputerManagedByAttribute
  • SetADOrganizationalUnitForComputer

Script Resources

 

Modern Driver Management uses a custom built PowerShell script that is invoked during operating system deployment. This script automatically detects the manufacturer, SystemSKU (used instead of model), operating system version and architecture being deployed and matches that information against the system being deployed in order to determine the matching driver package that should be downloaded.

1.1.8

(2017-11-07) Added support for driver fallback packages when the UseDriverFallback param is used

1.1.7

(2017-10-29) Changed the OSMaintenance parameter from a string to a switch object, make sure that your implementation of this is amended in any task sequence steps

1.1.6

(2017-10-29) Fixed an issue when detecting Microsoft manufacturer information

1.1.5

(2017-10-12) Added support for in full OS driver maintenance updates

1.1.4

(2017-09-19) Added support for installing driver package directly from this script instead of running a separate DISM command line step

1.1.3

(2017-09-18) Added support for downloading package content instead of setting OSDDownloadDownloadPackages variable.

1.1.2
(2017-09-15) - Replaced computer model matching with SystemSKU. Added script with support for different exit codes.
1.1.1
(2017-09-12) - Updated script to match the system SKU for Dell, Lenovo and HP models. Added architecture check for matching packages.
1.1.0
(2017-08-29) - Updated script to only check for the OS build version instead of major, minor, build and revision for HP systems.
$OSImageVersion will now only contain the most recent version if multiple OS images is referenced in the Task Sequence.
1.0.9
(2017-08-25) - Updated script to read package description for Microsoft models in order to match the WMI value contained within.
1.0.8
(2017-06-26) - Updated script with improved computer name matching when filtering out packages returned from the web service
1.0.7
(2017-05-26) - Updated script to filter OS when multiple model matches are found for different OS platforms.
1.0.6
(2017-05-22) - Updated script to detect the proper package based upon OS Image version referenced in task sequence when multiple packages are detected.
1.0.5
(2017-05-05) - Updated script to pull the model for Lenovo systems from the correct WMI class.
1.0.4
(2017-05-04) - Updated script to trim any white spaces trailing the computer model detection from WMI.
1.0.3
(2017-05-03) - Updated script with support for manufacturer specific Windows 10 versions for HP and Microsoft.
1.0.2
(2017-04-22) - Updated script with support for multiple operating systems driver packages, e.g. Windows 8.1 and Windows 10.
1.0.1
(2017-04-18) - Updated script with better support for multiple vendor entries.
1.0.0
(2017-03-27) - Original script.

 

Exit code

Description

1

Unable to establish a connection to ConfigMgr WebService

2

An error occured while calling ConfigMgr WebService for a list of available packages

3

An error occured while calling ConfigMgr WebService to determine OS Image version

4

An error occured while calling ConfigMgr WebService to determine OS Image architecture

5

An error occured while downloading driver package content (single package match)

6

An error occured while downloading driver package content (multiple package matches)

7

Unable to determine a matching driver package from package list array, unhandled amount of matches

8

Empty driver package list detected, unable to determine matching driver package

9

Call to web service for package objects returned empty

10

Unsupported computer platform detected, virtual machines are not supported

11

Unable to detect current operating system name from task sequence reference objects

12

An error occurred while attempting to download package content

13

Driver package content download process returned an unhandled exit code: <n>

14

An error occurred while applying drivers (single package match)

15

An error occurred while applying drivers (multiple package match)

16

Either empty or an unsupported count of fallback package content detected

17

An error occurred while downloading fallback driver package content

18

An error occurred while applying fallback drivers

19

An error occurred while applying fallback drivers. Exit code: <n>

20

Fallback driver package content download process returned an unhandled exit code: <n>

Implementation Instructions

Step 1 - Download and prepare driver packages

For our this approach to modern driver management we need to populate ConfigMgr with regular packages for client machines. If you are running Dell, HP or Lenovo hardware then you can use our Driver Automation Tool to do exactly that. Read the documentation embedded in the download package for Driver Automation Tool for more information on how the tool can be utilized. For the modern driver management solution, follow these instructions:

  • Launch the Driver Automation Tool and connect to your ConfigMgr environment by entering the name of your Site Server and click Connect To SCCM.
  • We now need to select the Deployment Platform as SCCM - Standard Pkg, then pick Drivers as the Download Type and pick your OS and 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 start the driver downloads.

Once downloaded you should end up with something like this in your ConfigMgr console:

Note: Remember to distribute the packages created by the Driver Automation Tool, unless you've specifically configured the tool to do that for you. For manually creating the packages, use the Driver Automation Tool to create a single package and follow the naming convention and including the different property configurations.

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.4.0. Detailed installation steps can be found in the documentation included in the ConfigMgr WebService package, downloadable from above.

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 method).

Step 3 - Configure your Task Sequence

Adding the required step in your Task Sequence for Modern Driver Management could not be simpler. Download the script called Invoke-CMApplyDriverPackage.ps1 from the Script Resources above. This script will automatically detect the computer model and manufacturer, operating system image version and architecture in the executing task sequence, by 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 are no matches at all, the script will exit, causing the deployment to fail. When a package matching the criteria required, task sequence variables used by OSDDownloadContent.exe will be set and that executable will be invoked. This automatically downloads the matching package for the model being deployed, making it available locally ready for driver injection by using dism.exe. Once the package is available locally, and the downloaded completed successfully, dism.exe will be invoked and inject the drivers. This script simply takes care of everything, and is the brains behind the modern driver management solution.

In the event of this script should fail, see the Documentation tab under Script Resources for a list of return codes that could be used for troubleshooting. In terms of logging, the script is writing to a separate log file called ApplyDriverPackage.log located in the same directory as the smsts.log file at the time of operation.

Follow this simple process of using the Invoke-CMApplyDriverPackage.ps1 script inside your task sequence:

  • Package the Invoke-CMApplyDriverPackage.ps1 script and distribute it to your Distribution Points.

  • Add a Run PowerShell Script command somewhere after the Apply Operating System step (make sure it's executed during WinPE and not in the Full OS), calling the Invoke-CMApplyDriverPackage.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 - Enter the term Driver or Drivers.

Post OSD Maintenance

The same process can be used to maintain both BIOS and drivers post OSD via the use of the OSMaintenance switch in the Invoke-CMApplyDriverPackage.ps1 script. An example of this is contained within the script under the examples section.

Driver Fallback Package

The driver fallback package does exactly what it says. In the event that no matching driver packages are found, you can have a general driver package with multiple generic drivers contained within. The package should be created using the Driver Automation Tool (5.0.3 and up) and all you need to do is drop your extracted drivers into the package source location, then use the UseDriverFallback switch in the Invoke-CMApplyDriverPackage.ps1 script parameters on run time.

See Modern Driver Management in action

In the below video you can see the entire Modern BIOS & Driver Management processes running during OS deployment. While the Driver Management task sequence step is running you will also see the individual drivers being downloaded.

For troubleshooting there is also an extensive log management process that runs during the execution of the script, exit codes are documented under the Script Resources - Documentation section of this post.

 


Comments are closed.