Using HP Image Assistant for driver updates in MEMCM

HP Image Assistant (HPIA) has become a useful tool for IT shops helping to automate the deployment and updating of PCs in an Enterprise. HPIA can be used to (not-including capabilities such as, quick access to Readme and CVA files, Advisories and Bulletins, etc.):

  • Update any and/or all HP deliverables to a supported platform
  • Create new, platform-specific driver packs
  • Deliver up to date drivers and other needed components during imaging
  • On-going update of managed PCs 

Because HP Image Assistant does not required to be installed and can run from a folder, in this blog, we will show how to use a similar process to deploy new, updated, Softpaqs. This is a task that, often, falls thru the cracks at enterprises, and may not have established processes for. The need, however, comes up when security updates or maybe problem resolution requires quick deployment of a driver, or BIOS. By maintaining a clean, up to date repository of HP Softpaqs, HPIA could be run on a schedule to update client devices.

This blog proposes methods to make the update process available from a client PC's MEMCM's Software Center. If the package is deployed as 'Required', the task would be enforced by the Config Manager's agent and run as scheduled.

As discussed in he blog HP Image Assistant and HP CMSL, this is the process for including the HP Script Library modules to PowerShell: 

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 HP CMSL.

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

PS> Install-Module -Name HPCMSL

Documentation for the CMSL is hosted here.

The first step is to set up the Repository and include the needs of Image Assistant.

Creating a Repository

Detailed Repository creation and maintenance steps are documented at the blog HP Image Assistant and HP CMSL. Note the critical step being an invocation of Set-RepositoryConfiguration to provide support for HP Image Assistant's offline mode. Execute the commands in Powershell from the Repository folder, after the Initialize-Repository command:

Initialize-Repository        # Create the folder structure required by the CMSL for Softpaq management

Set-RepositoryConfiguration -setting OfflineCacheMode -Cachevalue Enable   # set up HPIA compatibility

Follow the guidance at the blog and configure your repository for the systems you are supporting. Add repository Filters for drivers, bios, software, in any combination - as wanted for client updates.

After the Softpaq repository is available, develop a PowerShell script that will be pushed to the client and run as either a Package with a Program or a Task Sequence from the Software Center (if set as Available), or run automatically (if set as Required)

The Script

The following script can be a starting point. Notice that prior to running HP Image Assistant, the script does some sanity checks to confirm access to the repository share and to make sure some of the HPIA required components exist, like the .repository subfolder and other content. It also posts basic info to a log file on the client. You can develop your own logging information about the deployment, and also configure where the script log file should be.

NOTE: if your repository contains BIOS, Drivers, Software, and other and there is a need to ONLY install drivers, the runstring could be changed to add a "Category:Drivers" option. The default is "Category:All" and is implied. HP Image Assistant User Guide can be found at HPIAUserGuide.pdf
 

The "/SoftpaqDownloadFolder:C:\HPIA" option can be modified to point to a desired location on the client (e.g. C:\...) or the server (e.g. ..\share\...)

# HPIA script - by Dan Felman/HP Technical Consultant
# v1.0 initial release
# v1.1 copy HPIA logs to share - 4/29/2020

$CMShare = "\\CM01\share\softpaqs"
$HPIARepoShare = $CMShare+"\REPOSITORY"              # location of the HP IA repo
$HPIALogsShare = $CMShare+"\REPOLogs"                # ... where the logs will be cpied to
$HPIADownloadPath = "C:\HPIA"                        # Softpaq downloads will go here... can be removed afterwards
$HPIALogsPath = $HPIADownloadPath+"\Logs"            # where will HPIA put the logs on the client
$thisPC = hostname

# Create a date log file
if ( !(Test-Path $HPIALogsPath) ) { MD $HPIALogsPath }
$ScriptLog = "$($HPIALogsPath)\scriptdateandroot.log"
'Script execution Start='+(get-date) | Out-File $ScriptLog
'$PSScriptRoot Path='+$PSScriptRoot | out-file $ScriptLog -Append  # find where the script runs from

# basic checks on the repository
if ( !(Test-Path $HPIARepoShare) -or `
    !(Test-Path "$($HPIARepoShare)\.repository") -or`
    !(Test-Path "$($HPIARepoShare)\.repository\cache") -or`
    !(Test-Path "$($HPIARepoShare)\.repository\mark") ) {
    'Can not access Repository share, or share not properly configured for HPIA' | out-file $ScriptLog -Append
} else {
    'Repository share is accessible, and is structure compatible with HPIA' | out-file $ScriptLog -Append
}
# make sure the Run PowerShell Script TS Step starts at the HP IA folder

start-process -FilePath ".\HPImageAssistant.exe" -ArgumentList `
    "/Operation:Analyze",`
    "/Action:Install",`
    "/Selection:All",`
    "/Offlinemode:$HPIARepoShare",`
    "/SoftpaqDownloadFolder:$HPIADownloadPath",`
    "/ReportFolder:$HPIALogsPath",`
    "/Noninteractive",`
    "/Debug" `
    -Wait

'Script execution end='+(get-date) | Out-File $ScriptLog -Append

# finally, copy the HPIA log file(s) to the server share
if ( !(Test-Path "$($HPIALogsShare)\$($thisPC)") ) { MD "$($HPIALogsShare)\$($thisPC)" }
Copy-Item "$($HPIALogsPath)\Readme*.html" -Destination "$($HPIALogsShare)\$($thisPC)"
Copy-Item $ScriptLog -Destination "$($HPIALogsShare)\$($thisPC)"

My script is named StartHPIA.ps1 and will be located in a share folder '\\CM01\share\Applications\Scripts', where my scripts are kept. The script can also be copied to the HPIA folder, then run from same location as the application.

 

We will highlight 2 different methods for packaging HPIA in MEMCM.

Method 1. HP Image Assistant Package with built-in Program

Here, the package can be deployed with the associated Program to a device collection, as Available or Required

Create the package and point the Source folder to the HP IA share, as seen in the picture below:

On the next dialog, for the Program Type, select the default ‘Standard program’ and click Next. Fill-in the name, and for the Command line, type:

Powershell.exe -ExecutionPolicy ByPass -File \\CM01\share\Applications\Scripts\StartHPIA.ps1

Note: i maintain scripts in a common 'scripts' folder. If the script is copied to the HPIA folder, the Command line could be simplified as:

Powershell.exe -ExecutionPolicy ByPass -File .\StartHPIA.ps1

For the Startup folder, use the HPIA share – in this example:

\\CM01\share\Applications\HPIA 4.5.4.1

Run mode should be with ‘Administrator rights’ since we will be installing system drivers.

You can enable ‘Allow users to view and interact with the program installation’ if you want to see HPIA's execution steps on the client.

Distribute the Package to the Distribution Points, or, If making modifications, Update Distribution Points.

Finally, Deploy the Package to the appropriate Device Collection

In a few minutes, once the MEMCM Client syncs with the Management Point, the HPIA program will be available in the Software Center. Of course, you could deploy this as Required, and the package will execute on your schedule.

Method 2. HP Image Assistant Package in a Task Sequence

With the HPIA developed script, create a package in MEMCM

Populate the fields, pointing the Source folder to the scripts share (or the HPIA share if it resides on the same location)

On the next screen, select ‘Do not create a program’, and finish creating the Package. Distribute the package to the Distribution Point(s), or select Update Distribution Points when making changes to the package.

 

Task Sequence

The Task Sequence will have two steps, Connect to the Repository share, and Run PowerShell Script. The first step is not absolutely required (since the script already check that, and yours may not), but is always good practice.

The connect to share step is simple. Select Add, General, Connect to Network Folder. 

Make sure to use an appropriate account.

Next add a Run PowerShell Script step, and In the dialog, name the Step, Select the HP IA script Package we created above, add the script name (in our case StartHPIA.ps1) and for Start in: 'Browse' to the share folder where the HP Image Assistant application is located (here it’s “\\CM01\share\Applications\SP101503 HPIA 4.5.4.1”).

Recall that the script package already points to the scripts share. We need the script to start on the HPIA folder because our script uses “-Path .\HPImageAssistant.exe” to run the application, expecting it to be located in the ‘current’ location. This can be changed of course, if needed

Finally, Deploy the Task Sequence to the correct client devices Collection. Select ‘Available’ at Deployment Settings step - to have it accessible from the MEMCM Software Center.

Within a few minutes, on the client device, the Software Center will show the Task Sequence application

When the user selects the Task Sequence, HP IA will run and update anything available from the Repository, if needed.

If in the Deploy Software Wizard, the ’Required’ option is selected, the Task Sequence will run in the schedule supplied, or if set to As soon as Possible, whenever the agent syncs up with the server. Syncing can be sped up on the client device by going to the Options menu, then Computer Maintenance, and selecting Sync – handy for testing changes of the script package.

NOTE: This can take a couple of minutes or more to show as available, or to be able to Rerun the Task

Written by Dan Felman/HP Technical Consultant 4/20/2020

Author : dan.felman

Dan, I followed the instructions and created a repository and the task sequence. When I use it during OSD, it runs but when the computer restarts it does not see a boot disk. Is it possible to run the task sequence during OSD? It is towards the end of the task sequence.

in principle, i would say using HPIA for your OSD driver updates should not affect the Task Sequence boot disk. you do not provide much details on what you are doing, and if this is updating drivers on an existing system, or part of an re-imaging TS? you also do not mention anything about the computer you are updating, what dirves are in it (do they have an optane drive?)

So after all the default applications are installed, I run the task sequence on the boot disk. We only use HP computers so I created a group and added a WMI query: Select * from Win32_ComputerSystem WHERE Model LIKE "%HP%" Then I added the step to connect to the HPIA Repository. Then I added a step to run the powershell script StartHPIA.ps1 Then I added the step to Restart the Computer. It is after the restart that it comes up with no boot image found. This is part of our imaging Task Sequences. The first thing I do is wipe the disk and then create partitions. Then install Windows and all my applications. In this case the computer is an EliteDesk 800 G4 DM 65W machine. If I disable the group, it works everytime. I know image assist is working because it copies the logs to the server. Thanks, Donna

i would then try this troubleshooting step: run your imaging TS with the HPIA step disabled. Then, when you can login to the client after reboot, run HPIA manually, from a share, or even from a usb key. you can run the same runtime options from the share that points to the repo you created so in effect would be the same as running it from the TS. Again, HPIA just installs drivers so i don't see how that would change the boot order in any way. let us know the results. you may also want to post the CMSL commands you use to create the repository for the clients

Is HPIA installing bios?

Good day, Have an issue with the /OfflineMode While the Command-Line is correct: HPImageAssistant.dll /ipc:664,676,680 /Operation:Analyze /Category:Drivers /Action:Install /Selection:All /Offlinemode:"\\Path\Folder x\Drivers\Softpaqs\REPOSITORY" /SoftpaqDownloadFolder:C:\HPIA /ReportFolder:C:\HPDriverLog /Noninteractive /Debug As you can see, My /OfflineMode path does have a space and I correctly have it wrapped BUT then I get: /OfflineMode Repository path invalid \\Path\Folder x\Drivers\Softpaqs\REPOSITORY Exiting with exit code: InvalidParameters Can anyone PLEASE help me?

Kevin, it would be helpful to have the full HPIA command with options listed so we can comment on the actual run... However, this is a powershell string that HP Image Assistant will gather and then point to, to get to the repository share... the command should have no spaces, unless it is wrapped with a set of " "... you can look at that... also, as a troubleshooting step i always suggest to run the actual command on a local PC/Laptop and see if the tool would succeed... just an idea

SCCM Program Command line %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NoLogo -ExecutionPolicy ByPass -File .\StartHPIA.ps1 I'm using the same script as above. Just changed: $cmshare variable and start-process -arg "/Offlinemode:""$HPIARepoShare""",`

Manually ran this command in dos from the c:\windows\ccmcache\11 HPImageAssistant.exe /Operation:Analyze /Category:Drivers /Action:Install /Selection:All /Offlinemode:"\\Server\App Store\Drivers\Softpaqs\REPOSITORY" /SoftpaqDownloadFolder:C:\HPIA /ReportFolder:C:\HPDriverLog /Noninteractive /Debug This works