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.

Version 5.1.5
Changes: Updates to the code that deals with BIOS downloads. Updates to the HP BIOS download parsing code due to XML formatting changes

Version 5.1.4
Changes: Lenovo Update - Important: Package name will no longer include the SKU value in the package name.
Processing updates and minor tweaks.

Version 5.1.3
Changes: Updated to use new GetCWVersion method for 1.5.0 and later of the ConfigMgr web service

Version 5.1.2
Changes : Changed existing package method detection for standard and driver packages
Fixes: Typo Corrected

Version 5.1.1
New Features:
Added MDM/MBM diagnostics tab for testing connectivity to the ConfigMgr WebService

Version 5.1.0
Fixes : Fixed issue with scheduled task button not running function

  • 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.

General improvements

  • Inconsistency in parameter positioning has been addressed. The secretKey parameter is now required as the first parameter for all methods.
  • GetCMPrimaryUserByDevice has been renamed to GetCMPrimaryUserByDeviceName.
  • AddCMComputerToCollection now requires a device collection ID instead of the device collection name.
  • GetCMOSImageVersionForTaskSequence and GetCMOSImageArchitectureForTaskSequence now detects the proper information based upon the selected image index in the task sequence. This fixes a bug for when e.g. using a custom image that contains more than a single index or for Windows 10 version 1709 that changes the order of the indexes.
  • RemoveADComputerFromGroup now supports groups that contains more than 1500 members.

ConfigMgr WebService
GetCWVersion
NewCWEventLogEntry

Configuration Manager
GetCMApplication
GetCMCollectionsForDeviceByResourceID
GetCMCollectionsForDeviceByName
GetCMCollectionsForDeviceByUUID
GetCMFirstAvailableNameSequence
GetCMPrimaryUserByDeviceResourceId
RemoveCMPrimaryUserByDeviceResourceId

Microsoft Deployment Toolkit
RemoveMDTComputerByMacAddress

Active Directory
GetADComputer
GetADGroupsByUser
GetADGroupMembers
GetADGroupMemberByUser
RemoveADComputer

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.

Version 2.0.0

(2018-01-10) Updates include support for machines with blank system SKU values and the ability to run BIOS & driver updates in the FULL OS using the new DeploymentType switches

 

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.
    • DeploymentType - Here you can specify three different options.
      • BareMetal
        This is the default option and intended for a WinPE environment, using DISM to import and apply the matched driver package. Logs are saved into the log folder within the _SMSTaskSequence\Logs folder
      • OSUpgrade
        Intended for use as part of an in-place upgrade and uses the PNPUtil command to import the matched driver package. Logs are saved into the WinDir\Temp folder
      • DriverUpdate
        This switch is intended for use in a Full OS (Windows is running) environment. The PNPUtil command is also used in this method and logs are saved into the %SystemRoot%\Temp folder
        Example:
        Invoke-CMApplyDriverPackage.ps1 -URI "http://CM01.domain.com/ConfigMgrWebService/ConfigMgr.asmx" -SecretKey "12345" -Filter "Drivers" -DeploymentType DriverUpdate

Post OSD Maintenance

The same process can be used to maintain drivers post OSD via the use of the DriverUpdate value when specified with the DeploymentType 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.