Driver injection with HP Image Assistant and HP CMSL in CM (upd. 4/27/2021)

HP Image Assistant (since version 4.5.4) and the HP Client Management Script Library (since version 1.4.0) can team up to deliver intelligent and efficient installation of HP drivers, bios, and other HP software in a Microsoft Endpoint Management Configuration Manager (MEMCM), or other similar management environments. Recently added features support the ability for the CMSL to create and maintain offline, intranet hosted respositories. HPIA can then utilize these repositories during image deployment tasks or for normal driver updates, potentially eliminating the need to install driverpacks, or as a supplement to make sure any drivers installed during driverpack injection are up to date during the imaging steps. Other Management tools can also use the information in this blog to automate similar processes.

Previously, HP System Software Manager (SSM) has had this role for quite some time but required additional effort in managing the Softpaq store and over time could become confused as to which Softpaq made sense to install as the file store grew in size and number of softpaqs. The HP CMSL can clean up the repository so that only the latest release of any Softpaq (bios, driver, software, etc.) is available and ready.

This blog shows how to create and maintain a Softpaq repository, a step-by-step outline for Microsoft MEMCM to use it for client installations or updates, and download from a MEMCM Distribution point, instead of from HP.

Thanks, Quick/HP, Nathan/HP, and Val/HP, for your help checking out the process, finding my oversights, and helping clear the documentation.

Adding the CMSL to PowerShell

NOTE: Obtaining the CMSL from the Microsoft PowerShell gallery requires the use of the PowerShellGet module. If it needs installed, you can follow these steps to set it up (in PowerShell as Administrator):

PS > Install-PackageProvider -Name NuGet -Force # make sure Package NuGet is up to date 
PS > Install-Module -Name PowerShellGet  -Force # install the latest version of PowerSHellGet module

Exit your PowerShell command window and open a new one, also as Administrator - This seems to be a crtitical step, or you will see errors loading the HPCMSL module

The CMSL can be installed directly into PowerShell from the PowerShell Gallery (as the preferred method) with the PowerShellGet cmdlet:

PS> Install-Module -Name HPCMSL

Documentation for the CMSL is hosted here.

Creating a Repository

For this exercise, let’s assume the MEMCM server is named CM01, the MEMCM share to be used by the clients is set to \\CM01\share, and the downloaded and unpacked HP Image Assistant folder is at \\CM01\share\HPIA. We will keep the Softpaq repository as a separate place on the share so that only the needed Softpaqs are downloaded to the client device. The following commands will do what we need. As long as the client can access the HPIA folder and HPIA can access (read/write permission) the repository share, they can be hosted anywhere.

Note: Some of the following PowerShell command require that they be executed from the repository folder we create, as they cannot be pointed to a specific repository with a runtime option. Again, for this exercise, we will configure this folder as the repository: \\cm01\share\softpaq\repository

  1. In PowerShell, create and Initialize a repository. The CMSL commands will be running 'from' the repo share.
PS> MD \\CM01\share\Softpaqs\Repository
PS> CD \\CM01\share\Softpaqs\Repository
PS \\cm01\share\softpaqs\repository> Initialize-Repository         # do once
  1. Critical step, and required by HP Image Assistant – done once
PS \\cm01\share\softpaqs\repository> Set-RepositoryConfiguration -setting OfflineCacheMode -Cachevalue Enable  # do once
  1. Develop filters to let the library figure out what to download.

        For the current version of the HP CMSL (1.4.3), the category value must be one of [bios,firmware,driver,software,os,manageability,diagnostic,utility,driverpack,dock]. To use multiple values, separate filter value with a ‘,’.  HP CMSL commands will take parameter values as strings with or without quoting.

         Again, these commands need to be executed from the repository folder, as they currently do not have a way to specify a repository. They expect to be in the current folder. In the example, -platform ‘83b2’ = HP EliteBook 840 G5, and ‘8549’ = HP EliteBook 840 G6.

PS \\cm01\share\softpaqs\repository> Add-RepositoryFilter -os ‘win10’ -osver ‘1909’ -platform ‘83b2’ -category driver,bios
PS \\cm01\share\softpaqs\repository> Add-RepositoryFilter -os ‘win10’ -osver ‘1909’ -platform ‘8549’ -category driver
PS ...	add filters as required for the systems to be managed
  1. Sync and remove/clean-up superseded Softpaqs from the Repository (run command from the repository folder)
PS \\cm01\share\softpaqs\repository> Invoke-RepositorySync
PS \\cm01\share\softpaqs\repository> Invoke-RepositoryCleanup

Step 4 should be repeated on a regular basis, perhaps weekly to maintain the catalog. A PowerShell script with both commands can be used and run on a schedule. Make sure they are called from the Repository folder.

NOTE: if the Invoke-RepositorySync command fails to sync, the HP Image Assistant execution will also fail to install. Make sure there are no errors with the Step 4 commands

HP Image Assistant

HP Image Assistant (HPIA) can be downloaded from the HP Client Management Download Library home page: Client Management Solutions - HP Downloads | HP® Official Site. Downloading and executing the Softpaq will unpack at: C:\SWSETUP\sp101503 (the current 4.5.4 software version), Because HPIA was designed to not require installation, the folder can be copied to another location and run from there, even from a USB key.

We will be copying/moving the complete extracted HP IA folder to our share. For example, using Windows XCOPY from a CMD line:

C:> XCOPY C:\SWSETUP\sp101503\*.* \\CM01\share\HPIA\ /e

Or from a PowerShell window:

PS> copy-item -path c:\swsetup\sp101503\ -destination \\cm01\share\HPIA -recurse

When a new version of HP Image Assistant is available, all that is needed is to download, extract and copy the contents of the unpacked folder to the share, and update the MEMCM distribution Points.

For our purpose, HP Image Assistant will be used in an offline mode by pointing to the Repository folder. HP IA will execute from the package source at \\CM01\share\HPIA and use the offline repository we developed. This command will be added to the Deployment Task Sequence as a Run Command:

NOTE: When scripting HPIA you can use /Silent and /Noninteractive switches. /Currently, both should behave similarly, but one should be sufficient, for example /Noninteractive alone.

HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Offlinemode:"\\CM01\share\softpaqs\Repository" /SoftpaqDownloadFolder:C:\HPIA /ReportFolder:C:\HPIA\Logs /Noninteractive /Debug

Let’s package this for MEMCM

MEMCM

The HP Image Assistant Package

The HP Image Assistant application will also need an MEMCM package. Create a new package, select ‘Do not create a program’, and complete the process.

Next, distribute the Package

Deployment Task Sequence

Open the Deployment Task Sequence, and after the Windows image is applied step and after the first reboot, add a new Run Command step.

Use the command shown next for the command line. The /offlinemode: parameter is what tells HP Image Assistant to look at a repository instead of hp.com for available Softpaqs to install.

NOTE: the /SoftpaqDownloadFolder: option is where the downloaded Softpaqs will reside before they are installed on the client. This example will save the files on C:\HPIA. If there is no need to keep the Softpaqs in the client, the path could be set to something like /SoftpaqDownloadFolder:.\downloads, which will then be cleaned up at the end of the Task Sequence.

NOTE: the /Debug option will make HP IA write a working log, in our case due to running prior to user profiles being created, will reside at C:\Windows\Temp\HP Image Assistant.log

HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Offlinemode:"\\CM01\share\softpaqs\Repository" /SoftpaqDownloadFolder:C:\HPIA /ReportFolder:C:\HPIA\Logs /Noninteractive /Debug

Check the ‘[X] Package” setting on the page,  and point to the HP IA package created earlier. Also check ‘Continue on error’ in the Options tab. This is necessary in case a Softpaq does not install correctly.  Without ‘Continue on error’  the step might end in an error state.

Note that we are also putting the HPIA log files in the client’s C:\HPIA\Logs folder

When the Task Sequence executes, after the first reboot, HP Image Assistant downloads from its package source and runs on the client. The /OfflineMode: parameter references the repository share to pull all needed Softpaqs to install on the client.

Once the client rebooks, you will see the downloaded Softpaqs in C:\HPIA and the logs at C:\HPIA\Logs