Apply Firmware and Driver Updates Using HP Image Assistant

The HP Image Assistant (HPIA) has been around for a little over a year. I hadn’t given it much thought until my HP Technical Consultant shared some of the capabilities of the product. It turns out, this product makes my previous post on HP SSM usage a bit outdated.

Why HPIA over SSM?
There are many advantages to using HPIA over SSM. When SSM is used in a task sequence, it actually needs to be run twice. This will allow for installing the management engine driver on the first pass, followed by updating management engine firmware on the second pass. HPIA has some logic built in for handling these types of issues in the proper order. Overall, HPIA also runs faster than SSM.

How does HPIA work?
Download and extract the latest HPIA version. Running HPImageAssistant.exe as an admin will give you a GUI with relevant information about the current machine. When run with a silent command, HPIA reaches out to the HP servers to download what is needed for the current model and running Windows build. Once the needed softpaqs are downloaded, they are automatically expanded locally and applied to the system.

There are multiple silent ways that HPIA can be used. What fits best for your organization will depend on a lot of factors. There are pros and cons to each of the following methods, which I will detail later in this post.

  1. Allow HPIA to download what is needed directly from HP.
  2. Allow HPIA to download what is needed directly from HP, but also build a repository on a shared UNC path within your network.
  3. Use the HP Client Script Management Library to automate sync and cleanup of softpaq repositories for use with ConfigMgr packages.

Method 1: Allow HPIA to download what is needed directly from HP.
The following silent command will analyze the current model, then download and install any needed firmware and driver softpaqs.

HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Silent /ReportFolder:C:\SrcCode\HPIA\Logs /SoftpaqDownloadFolder:C:\SrcCode\HPIA\Drivers /BIOSPwdFile:pwd1.bin

This method is a good way to try out the solution, but does not scale well as you will need to wait for each individual device to download and extract what it needs from HP servers. The /SoftpaqDownloadFolder switch will determine where the softpaqs are stored. Subsequent runs of the silent command on the same system will be quicker as softpaqs that do not have a newer version released will not need to be downloaded again. You can also create a ConfigMgr package containing the HPIA extract if you don’t mind the machine reaching out to HP and downloading everything into the local package cache every time OSD or IPU is run.

Method 2: Allow HPIA to download what is needed directly from HP, but also build a repository on a shared UNC path within your network.
This method is a slight improvement compared to method 1 as the shared UNC path will contain softpaqs for all models in your environment. The following example also places the log file in the same share.

HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Silent /ReportFolder:\\server\share\HPIA\Logs /SoftpaqDownloadFolder:\\server\share\HPIA\Drivers /BIOSPwdFile:pwd1.bin

This is a good solution for manually running, and could also be used with a ConfigMgr package containing the HPIA extract. In this case, the task sequence step would use what has been previously downloaded to shared UNC path. Should HP release a newer version of anything, the first client running HPIA silently will automatically download and extract the newer version to the shared UNC path. Subsequent runs will again use what is there.

Method 3: Use the HP Client Script Management Library to automate sync and cleanup of softpaq repositories for use with ConfigMgr packages.
Method 1 and 2 are easy ways to get started with HPIA. Unfortunately, both these methods do not include a cleanup feature. To keep the repository clean and reclaim used disk space, you would periodically need to delete the contents of the shared UNC path and start over. Also, many environments do not have fast links between sites, so connecting to a shared UNC path may not be ideal. Using much of the same script from my previous SSM post, method 3 will keep the model repositories synchronized and cleaned up, and distributed through ConfigMgr. Much of the script is the same, with two main differences.

  1. Instead of copying the SSM files, I am now copying the latest version of the HPIA extract to each package.
  2. Older platforms often do not have the newest cab file support for the osver option in the script. After discussing with @nkofahl (Client Technology Consultant with HP), the least risky option is to use the newest cab osver available for each model with the newest Windows 10 build. Test this thoroughly, as your mileage may vary. For now, I have added the latest supported osver to the model table to account for which of our models do not support 1903. HP is working toward a way to
    programmically return a list of supported osver, which will allow for automating the osver choice. I recommend manually determining which Windows 10 builds are supported for your models by creating a temporary repository, adding a filter for each of your models, and invoke a sync. You will receive a failure should a data file not be found for the platform.

    EDIT: Running HPImageAssistant.exe, then selecting ‘Supported Platforms’ under the ‘Help’ menu.

The following script will loop through the models table and do the following:

1. Update an existing repository or create a new repository if one doesn’t exist
2. Setup email alerts to notify of sync failures
3. Invoke a repository sync for bios and driver and firmware categories
4. Invoke a repository cleanup to remove old versions
5. Ensure the needed HPIA files are up to date

NOTES: 
Running the Script: The script can be run on demand or as a scheduled task. Unless you include the -quiet switch on the Invoke-RepositorySync command, you should see something similar to the following when running the script.


Script running, currently in the Invoke-RepositorySync step for an HP EliteDesk 800 G1 SFF

Logging: The logging feature was created by @EphingPosh and is posted at https://www.ephingadmin.com/powershell-cmtrace-log-function/. In my environment, I added this as a separate module, but it could be added to the top of the script as well. This logging is done in CMTrace format for easy readability.

CMTrace formatted script log

Repository Logging: In addition to the script log, HP has a useful repository log called activity.log located in the \.repository subfolder. This shows information about all repository activity (total number of SoftPaqs to be downloaded, what file is currently being downloaded to the repository, etc).

CVA Files: The CVA files that accompany each SoftPaq include the details about what models the SoftPaq is applicable, among other info. These files are frequently updated, so the Invoke-RepositorySync downloads and overwrites these files at every sync. They are very small text files, so this step does not usually increase the script runtime significantly.

Package Setup:
In order to use HPIA within a task sequence, a package needs to be created and distributed. The script above created the folder structure and all the files needed. At this point, create a package without a program for each of your models. Because I run the repository script as a scheduled task, I enabled the ‘Update distribution points on a schedule’ and ‘Enable binary differential replication’ options on the package to automatically distribute updated content to distribution points.

HPIA package for an HP ProBook 440 G6

Task Sequence Setup
Within a task sequence, add a ‘Run Command Line’ after the first reboot into the Full OS. Use the package you created for the specific model, and run the following command line. My previous blog posts have queried the model from Win32_ComputerSystem. My HP Technical Consultant recommended changing to querying Win32_baseboard as that is more accurate.

Task sequence step referencing the HPIA package
WMI Query for an HP ProBook 440 G6 using the baseboard value, which matches the HP platform value
Module for nested task sequence of HPIA steps. One step/package for each model.

HPIA Process
During the task sequence, the HPIA package is downloaded to the local client cache, which includes the HPIA extract itself and all updated softpaqs based on the repository sync. Within the local cache, HPIA will extract and install the softpaqs. HPIA will also check HP servers and download any newer versions of the softpaq to the local cache. This download is only local to that particular machine, so if you happen to image multiple machines with the outdated repository, they will all have to complete the download. This shouldn’t happen too often depending on how frequently the repository update script is run.

BIOS Password
I have a bios password configured on all systems. Note the /BIOSPwdFile switch in the HPIA command. This will need to be utilized with an encrypted password bin file in the package in order to update the bios category with HPIA. Creating the encrypted bin file is rather self explanatory using the HP Bios Configuration Utility (BCU). I have also recently learned that the
HP Client Script Management Library has a
Set-HPBiosSettingValuesFromFile function that could also be used in place of the BCU. This will allow for the password to be passed as a string, and also configured to have the cmd not log. This results in no bin file remaining. @miketerrill intends to release a blog post on this after the @MMSMOA conference concludes.

92 thoughts on “Apply Firmware and Driver Updates Using HP Image Assistant

  1. How stable have you found the HP library to be? I’ve been doing some testing with your script and the latest version of the HP library and I’m running into some critical bugs in the HP modules. I guess I’ll reach out to Nathan Kofahl and see if I can report these things and help improve it. But I’m less optimistic now than I was when I first read this post. Are you using this in production or just testing?

    Like

    1. Are you having issues with the script library and invoke-repositorysync, or with HPIA? I have not had any issues with the powershell library on the models in the table in my script. You will need to confirm that each of your platforms are supported with the osver you are attempting to sync. My previous SSM post just assumed all models used the same. The sync will fail if a cab isn’t available for the platform, which is why I hard coded the osver for each model in my script. It sounds like HP is working on a way to grab the supported osver for each model with PowerShell. For now, HPIA can be used to see a list of supported osver for each platform.

      At this point, I have used this successfully for OSD in the lab, which represents each of my model platforms. I am working with support on one of my platforms failing in the HPIA step, so hopefully they will help me find that issue. Assuming all goes well, I am looking to implement this for our summer imaging rotation.

      Like

      1. Just issues with the script library. I’ve been in contact with Nathan and submitted a bug report, which it sounds like they already have in the pipeline to be resolved in version 1.3. For now, I’m finding ways to work around the issue. Haven’t run into any issues with HPIA lately. And we’re still holding steady on 1709 in production, so cab availability hasn’t been an issue either.

        Like

  2. I am completely new to deploying OSD to HP machines via SCCM. I’ve only ever used Dell’s. We recently acquired a new office which uses some somewhat old HP models (among others). My question is, if I download the SoftPaqs to our primary SCCM server, then distribute these SoftPaqs in “packages” to our DPs; when the script runs the HPImageAssist.exe during OSD, will it be using our DP as the package source, or the PRI?

    Like

    1. Any package you reference in an OSD task sequence will be downloaded to the local machine’s cache ahead of running the step. In my example, the latest SP files synced to the repository will be included in the package. The idea here is most/all of what you need for HPIA to run will be local to the machine, downloaded from the distribution point. At OSD time, the machine will check with HP.com to see if there is anything newer than what is in the now local repository. If it finds something newer, it will download and apply automatically. Take note of the /SoftpaqDownloadFolder switch in the command. With an OSD task sequence, this references a subfolder within the downloaded package.

      Some organizations don’t want the machines to reach out to HP as you could be using an untested firmware or driver revision. HP has taken this feedback and is considering a completely offline option.

      Like

  3. Hi! Great work thanks for sharing! All this means that you do not install sys/inf related drivers? Do you only install drivers with the complete spxxxxx.exe after the first reboot into the os during task seqeunce?

    Like

    1. I have the HPIA step running immediately upon the first boot into the full OS. This eliminates importing any inf based drivers into the driver store. I believe the only exception would be if you have a network or storage driver that is needed for your boot image, but I have not run across that issue with our models.

      I have all the driver, bios, and firmware softpaqs synced to the repository. You could certainly remove any of those options from the sync script.

      Like

  4. I’m assuming this works for Windows 7 drivers as well? I’m dealing with some very old equipment in a new facility overseas. Some can run Win 10 and some cannot. Would that be a limiting factor?

    Like

    1. The os is defined by a variable at the top of the script. Valid values are win7, win8, win81, win8.1, and win10. However, you will need to confirm your platform is supported for windows 7. This can be done by clicking ‘Help > Supported Platforms’ within the HPImageAssistant.exe GUI ahead of time. If the OS you enter isn’t supported, the script should skip and move on to the next model in the table.

      Like

  5. Hi Ryan,

    Is there a need to package the HP Image assistant with the drivers? I am not understanding how that application is linked in the Task Sequence and able to run without it being in there somewhere.

    Thanks!

    Like

    1. Yes, you need HPIA in the package. My script puts it there at the end. It is then used in the run command line step in the sequence, with the synced repository folder specified as the content location.

      Like

  6. Would it be possible to show the steps in your Task Sequence? I am having issues getting this to work. It does not even appear that HP Image Assistant is running.

    Thanks!

    Like

    1. Since I wrote this post, I have created a task sequence module to run the HPIA steps for my models. This made it easier to nest the steps in multiple task sequences. I just added another image to the post showing what this looks like. I also would confirm you have valid syntax in the on the options tab wmi query for identifying the model. If that query isn’t correct for the platform, it will skip it. The task sequence log should also give some more clues.

      Like

  7. I’m just starting to test this method for maintaining a driver repository and am running into some issues. This is what the \Repository\.repository\activity.log shows for each model provided in the table. I’m using the same version of the HP CMSL (1.2.1) running Windows Server 2012 R2.

    Repository initialized succesfully.
    Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    Error – Failed to modify repository configuration: The variable ‘$_’ cannot be retrieved because it has not been set.
    DOMAIN\Admin – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    Error – Could not remove filter from repository: The variable ‘$_’ cannot be retrieved because it has not been set.
    Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    Error – Could not add filter to repository: The variable ‘$_’ cannot be retrieved because it has not been set.
    Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    Error – Repository synchronization failed: The variable ‘$_’ cannot be retrieved because it has not been set.
    An error occured during softpaq synchronization.
    The error was: The variable ‘$_’ cannot be retrieved because it has not been set.
    Details:
    ErrorRecord : The variable ‘$_’ cannot be retrieved because it has not been set.
    StackTrace : at System.Management.Automation.VariableOps.GetAutomaticVariableValue(Int32 tupleIndex, ExecutionContext executionContext, VariableExpressionAst varAst)
    at System.Management.Automation.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)
    at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
    WasThrownFromThrowStatement : False
    Message : The variable ‘$_’ cannot be retrieved because it has not been set.
    Data : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
    InnerException :
    TargetSite : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext, System.Exception)
    HelpLink :
    Source : System.Management.Automation
    HResult : -2146233087
    Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-07-17T09:31:14.535-04:00; DateLastModified=2019-07-17T09:31:14.582-04:00; CreatedBy=DOMAIN\Admin; ModifiedBy=DOMAIN\Admin; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    Error – Could not initialize the repository: The variable ‘$_’ cannot be retrieved because it has not been set.
    Beginning repository cleanup
    Completed repository cleanup, deleted 0 files.

    Any guidance would be appreciated. Thank you!

    -Adam

    Like

      1. Ryan,

        I ended up installing WMF 5, and it magically started working, although I’m having trouble getting some models to pull down their files, even though they’re listed here as having 1903 drivers:
        http://ftp.hp.com/pub/caps-softpaq/cmit/HP_Driverpack_Matrix_x64.html

        This is just a start… I still have about 10 more desktops and all our laptop models to go.

        $HPModelsTable= @(
        @{ ProdCode = ‘1825’; Model = “HP EliteDesk 800 G1 DM”; OSVER = 1903 }
        @{ ProdCode = ‘1998’; Model = “HP EliteDesk 800 G1 SFF”; OSVER = 1903 }
        @{ ProdCode = ’18E4′; Model = “HP EliteDesk 800 G1 TWR”; OSVER = 1903 }
        @{ ProdCode = ’18E5′; Model = “HP EliteDesk 800 G1 USDT”; OSVER = 1903 }
        @{ ProdCode = ‘8053’; Model = “HP EliteDesk 800 G2 TWR”; OSVER = 1903 }
        @{ ProdCode = ‘829A’; Model = “HP EliteDesk 800 G3 DM 35W”; OSVER = 1903 }
        @{ ProdCode = ’18E9′; Model = “HP ProDesk 400 G1 SFF”; OSVER = 1903 }
        @{ ProdCode = ‘8105’; Model = “HP ProDesk 400 G2.5 SFF”; OSVER = 1903 }
        @{ ProdCode = ’18E7′; Model = “HP ProDesk 600 G1 SFF”; OSVER = 1903 }
        @{ ProdCode = ‘8169’; Model = “HP ProDesk 600 G2 DM”; OSVER = 1903 }
        @{ ProdCode = ‘805D’; Model = “HP ProDesk 600 G2 SFF”; OSVER = 1903 }
        )

        Speaking of which, how do you handle different varieties of the same model when they all use the same drivers? For example, all of these models are included in sp96758.exe:
        HP EliteDesk 700 G1 Microtower PC
        HP EliteDesk 705 G1 Desktop Mini PC
        HP EliteDesk 705 G1 Microtower PC
        HP EliteDesk 705 G1 Small Form Factor PC
        HP EliteDesk 800 G1 Base Model Small Form Factor PC
        HP EliteDesk 800 G1 Base Model Ultra-slim PC
        HP EliteDesk 800 G1 Desktop Mini PC
        HP EliteDesk 800 G1 Tower PC
        HP EliteDesk 880 G1 Tower PC
        HP EliteOne 705 G1 23-inch Non-Touch All-in-One PC
        HP EliteOne 800 G1 21.5-inch Non-Touch All-in-One PC
        HP EliteOne 800 G1 All-in-One PC
        HP ProDesk 600 G1 Desktop Mini PC
        HP ProDesk 600 G1 Small Form Factor PC
        HP ProDesk 600 G1 Tower PC
        HP ProDesk 680 G1 Tower PC
        HP ProOne 600 G1 All-in-One PC

        Can they somehow share a repository, or do you really need 1 per model with potentially identical folders to maintain?

        Thanks a lot for all of the helpful information.

        Like

  8. There are a few different options here depending on how you want to handle things in your environment and what you are using to deploy.

    In my lab I keep model per folder as per Ryan’s script. I actually use SSM to deploy from this repository, but HPIA is fine if you understand a few limitations. The first being that it still goes to the net for the cab file and the knowledge base file. It won’t download softpaqs that already exist in your download directory (the package or the share, etc), but it will still need internet access. We’re looking at improving this. The second being that it works much better when you put it in a package as opposed to a share due to the way it extracts softpaqs. We’re looking at improving this.

    You can subscribe a bunch of different models to a given folder and the script library is smart enough only to download one copy of the softpaq and only delete a softpaq when it falls off of all reference images. You could then use this repository as the package source for package that you use for “like” models. If you decide to remove a model from your environment you can modify the repository configuration and the softpaqs that were only used by that model will be deleted as soon as you run your next repository clean up action.

    I’m using SSM mostly in my lab because it plays nicer with the network share where i have my repositories setup. In the one model per folder method for clean up i just remove the folder and the line in the model table. The end result is the same. I have about 8 models i’m currently supporting in my lab, so it isn’t a huge amount of space.

    Email me your activity.log file first initial last name @hp.com

    I’ll have the team look at it.

    Like

    1. Nathan,

      I assume this was a response to my post. Due to our sprawling environment and reluctance to toss aging equipment (instead opting to simply install an SSD + more RAM), here’s my model table.

      $HPModelsTable= @(
      @{ ProdCode = ‘158A’; Model = “HP Z620 Workstation”; OSVER = 1903 }
      @{ ProdCode = ‘1825’; Model = “HP EliteDesk 800 G1 DM”; OSVER = 1903 }
      @{ ProdCode = ’18E4′; Model = “HP EliteDesk 800 G1 TWR”; OSVER = 1903 }
      @{ ProdCode = ’18E5′; Model = “HP EliteDesk 800 G1 USDT”; OSVER = 1903 }
      @{ ProdCode = ’18E7′; Model = “HP ProDesk 600 G1 SFF”; OSVER = 1903 }
      @{ ProdCode = ’18E9′; Model = “HP ProDesk 400 G1 SFF”; OSVER = 1903 }
      @{ ProdCode = ‘1998’; Model = “HP EliteDesk 800 G1 SFF”; OSVER = 1903 }
      @{ ProdCode = ‘2101’; Model = “HP ProBook 640 G1”; OSVER = 1903 }
      @{ ProdCode = ‘212A’; Model = “HP Z640 Workstation”; OSVER = 1903 }
      @{ ProdCode = ‘212B’; Model = “HP Z440 Workstation”; OSVER = 1903 }
      @{ ProdCode = ‘2216’; Model = “HP EliteBook 840 G2”; OSVER = 1903 }
      @{ ProdCode = ‘802F’; Model = “HP Z240 Tower Workstation”; OSVER = 1903 }
      @{ ProdCode = ‘8053’; Model = “HP EliteDesk 800 G2 TWR”; OSVER = 1903 }
      @{ ProdCode = ‘8055’; Model = “HP EliteDesk 800 G2 DM 35W”; OSVER = 1903 }
      @{ ProdCode = ‘8062’; Model = “HP ProDesk 400 G3 SFF”; OSVER = 1903 }
      @{ ProdCode = ‘805D’; Model = “HP ProDesk 600 G2 SFF”; OSVER = 1903 }
      @{ ProdCode = ‘806A’; Model = “HP ProDesk 400 G2 MINI”; OSVER = 1903 }
      @{ ProdCode = ‘8079’; Model = “HP EliteBook 840 G3”; OSVER = 1903 }
      @{ ProdCode = ‘8105’; Model = “HP ProDesk 400 G2.5 SFF”; OSVER = 1903 }
      @{ ProdCode = ‘8169’; Model = “HP ProDesk 600 G2 DM”; OSVER = 1903 }
      @{ ProdCode = ’81C5′; Model = “HP Z4 G4 Workstation”; OSVER = 1903 }
      @{ ProdCode = ‘827D’; Model = “HP EliteBook x360 1030 G2”; OSVER = 1903 }
      @{ ProdCode = ‘828C’; Model = “HP EliteBook 840 G4”; OSVER = 1903 }
      @{ ProdCode = ‘8298’; Model = “HP EliteDesk 800 G3 TWR”; OSVER = 1903 }
      @{ ProdCode = ‘829A’; Model = “HP EliteDesk 800 G3 DM”; OSVER = 1903 }
      @{ ProdCode = ‘829A’; Model = “HP EliteDesk 800 G3 DM 35W”; OSVER = 1903 }
      @{ ProdCode = ‘829A’; Model = “HP EliteDesk 800 G3 DM 65W”; OSVER = 1903 }
      @{ ProdCode = ‘829E’; Model = “HP ProDesk 600 G3 DM”; OSVER = 1903 }
      @{ ProdCode = ’82B4′; Model = “HP ProDesk 600 G3 SFF”; OSVER = 1903 }
      @{ ProdCode = ’83B2′; Model = “HP EliteBook 840 G5”; OSVER = 1903 }
      @{ ProdCode = ’83B2′; Model = “HP EliteBook 850 G5”; OSVER = 1903 }
      @{ ProdCode = ’83E9′; Model = “HP EliteDesk 705 G4 DM 35W (TAA)”; OSVER = 1903 }
      @{ ProdCode = ’83E2′; Model = “HP EliteDesk 800 G4 DM 35W”; OSVER = 1903 }
      @{ ProdCode = ’83E2′; Model = “HP EliteDesk 800 G4 DM 35W (TAA)”; OSVER = 1903 }
      @{ ProdCode = ’83EE’; Model = “HP ProDesk 600 G4 SFF”; OSVER = 1903 }
      @{ ProdCode = ’83F3′; Model = “HP ProDesk 400 G4 DM”; OSVER = 1903 }
      @{ ProdCode = ’83F3′; Model = “HP ProDesk 400 G4 DM (TAA)”; OSVER = 1903 }
      @{ ProdCode = ‘8414’; Model = “HP Elite x2 1013 G3”; OSVER = 1903 }
      @{ ProdCode = ‘8438’; Model = “HP EliteBook x360 1030 G3”; OSVER = 1903 }
      @{ ProdCode = ‘8455’; Model = “HP Z2 Tower G4 Workstation”; OSVER = 1903 }
      @{ ProdCode = ‘845A’; Model = “HP EliteDesk 800 G4 DM 65W”; OSVER = 1903 }
      )

      Turned out I just happened to include a number of unsupported models in my initial list — overall it was quite successful. The only models with empty repositories are:
      HP EliteDesk 800 G1 SFF
      HP EliteDesk 800 G1 TWR
      HP EliteDesk 800 G1 USDT
      HP ProDesk 400 G1 SFF
      HP ProDesk 600 G1 SFF

      In total, I’ve got a ~67GB driver library. I’d be happy to send you the activity logs, but they all pretty much say the same thing:
      Reading the softpaq list for platform [ProdCode]
      Error – Repository synchronization failed: Could not find a data file for this platform.
      An error occured during softpaq synchronization.

      We’re a roughly 95% HP shop, but we do also support Microsoft Surface devices. I checked, and they do have BaseBoard values that match their product types (Book / Pro 3 / Pro 4), so I should theoretically be able to incorporate a similar process for them.

      Thanks,
      Adam

      Like

      1. Yes, Nathan’s response was directed to you. That is a lot of models! We are fortunate that what you see in my script on the blog post is what we have in our environment, so duplicating similar repositories isn’t too bad from a storage standpoint. The original version of the script had osver as one variable. I ended up putting it into the models table so that you could download different versions for older models. If you launch the HPImageAssistant.exe GUI, you can look up version support under Help > Supported Platforms.

        Like

      2. Adam,
        as time goes on the 1903 reference images will be more broadly available. I can probably gather some data internally for when they will be released, but can’t really post that in a public forum/blog. You might be better off keeping some of those older models on 1809 until a reference image is released.

        Like

    2. So, just an update on where I stand with this. We use MDT for image deployments here, so I combined a few approaches to come up with this method.

      I have the download script working. It populates a folder per model we have in our environment (although I’m now wondering if I should just have a single folder for everything). Each installer has a like named CVA file.
      HPIA\\Repository
      sp00000.cva / sp00000.exe

      Along with the 5 models that cannot find 1903 drivers, I’ve been receiving this lately for one SP:
      (Warning) Could not retrieve CVA file metadata for sp96965.
      Exception calling “DownloadData” with “1” argument(s): “The remote server returned an error: (404) Not Found.”
      (Warning) Could not retrieve https://ftp.hp.com/pub/softpaq/sp96501-97000/sp96965.exe.
      Exception calling “GetResponse” with “0” argument(s): “The remote server returned an error: (404) Not Found.”

      Now, on to the task sequence. I have a group using these WMI queries to determine whether to perform an HP model discovery:
      select * from win32_baseboard where Manufacturer like “%HP%”
      select * from win32_baseboard where Manufacturer like “%Hewlett-Packard%”

      If either are true, I first set a Task Sequence Variable I called “HPModel” to the value “UnknownHP”. This allows me to catch any HP models that are new/unsupported.

      Then I run through each known baseboard model and set the HPModel variable accordingly. Example:
      select * from win32_baseboard where product like “%83B2%”
      HPModel = HP EliteBook 840 G5

      Later in the task sequence, I have another group called “Install HP Driver Pack”, which executes on the condition If HPModel Exists.

      At first, I had HPIA run a single time, but I noticed that not all drivers were installing. Additionally, on occasion a loss of network connectivity (perhaps because of a NIC or docking station update) would cause one of these messages to appear.
      The network location cannot be reached. For information about network troubleshooting, see Windows Help.
      The network path was not found.

      Unfortunately, they have the effect of completely halting the imaging process, since they require you to hit “OK”. This is something that I hope can be fixed.

      Each phase is followed by a reboot (# is a placeholder for 1 -> 5).

      For known models (HPModel Not Equals UnknownHP):
      Step Name: Installing Drivers for %HPModel% (Phase #)
      Command Line: %DeployRoot%\Tools\HPIA\HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Silent /ReportFolder:”%DeployRoot%\Logs\HPIA\%ComputerName%\Phase#” /SoftpaqDownloadFolder:”\\SRV1\HPIA$\%HPModel%\Repository”

      For unknown models (HPModel Equals UnknownHP):
      Step Name: Installing Drivers for Unknown Model %HPModel% (Phase #)
      Command Line: %DeployRoot%\Tools\HPIA\HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Silent /ReportFolder:”%DeployRoot%\Logs\HPIA\%ComputerName%\Phase#” /SoftpaqDownloadFolder:”\\SRV1\HPIA$\%MODEL%”

      My test computer is an HP EliteBook 840 G5. After an imaging run, its repository folder also contained a number of subfolders with unpacked Softpaqs.

      “sp84846 HP Hotkey Support”, for example, also had a new corresponding sp84846.exe in the root (but no CVA).

      “sp95071 HP Universal Camera Driver” corresponded to an existing sp95071.exe that had been downloaded by the script.

      Checking the logs from each phase, all of which share this:
      Target Image (Last modified: 2019-07-30)
      Reference Image (Last modified: 2019-07-27)

      Phase 1:
      Overall Health: Red Dot
      Overall Security: Orange Dot

      Drivers
      Missing Drivers 8
      Out-of-Date 15

      Software
      HP Recommended 4
      Out-of-Date 1

      Phase 2:
      Overall Health: Red Dot
      Overall Security: Orange Dot

      Drivers
      Missing Drivers 1
      Out-of-Date 11

      Software
      HP Recommended 4
      Out-of-Date 1

      Phase 3 (and all subsequent phases):
      Overall Health: Orange Dot
      Overall Security: Orange Dot

      Drivers
      Missing Drivers 0
      Out-of-Date 6

      Software
      HP Recommended 0
      Out-of-Date 1

      Under recommendations:
      3 drivers indicate “HP update recommended”
      4 accessories indicate “HP update recommended”

      Readme (20190730 130821).html contains:
      Sequence Solution Component Version Status Comments Installation Notes
      1 HP Pointing Device Driver SP96996 HID-compliant touch pad 19.5.9.38 Pass
      2 Intel Video Driver and Control Panel SP94579 Intel(R) UHD Graphics 620 Intel(R) Display Audio 25.20.100.6472 Fail

      If I try to run the executable associated with SP94579 manually (not the batch file, but the executable in non-silent mode), I receive the following error:
      This computer does not meet the minimum requirements for installing the software.

      So, that seems to be an issue. I also don’t know why it’s not installing all of the HP recommended drivers. Is that a different switch I need to pass to HPIA?

      Thanks for your time.

      -Adam

      Like

  9. Hi there, in regards to this, is there no way to stop the HPImageAssistant from checking HP.com first, as we have already downloaded it using your script

    Some organizations don’t want the machines to reach out to HP as you could be using an untested firmware or driver revision. HP has taken this feedback and is considering a completely offline option.

    Like

    1. Hello Kieren,

      At this time, there is no way to prevent the machines from reaching out to HP. The machine first grabs the newest cab file for the platform and osver, then will download anything that is newer than what is in your repository. You are correct in stating HP is working on a completely offline option for HPIA. In the meantime, you can check out my SSM post which will use a similar repository, but remain completely offline. https://ryandengstrom.com/2019/04/09/apply-firmware-and-driver-updates-using-hp-system-software-manager/

      Like

  10. thanks Ryan…..am running into 16384 errors (The reference file failed to open.) any ideas on what file is failing to open? Seems to run fine when I manually run the command….just not when sccm invokes it. thanks

    Like

  11. I am trying this out on a “HP EliteBook 840 G6” using the following syntax;
    HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /Silent /ReportFolder:\\sccmserver\HPIA$\Logs /SoftpaqDownloadFolder:\\sccmserver\HPIA$\Drivers /BIOSPwdFile:pwd1.bin /Debug

    When I run it from within a full Win10 1903 session it will install all drivers but running it from the task sequence will fail on “sp96977 Intel Chipset Installation Utility” with exit code 8194 and a device will be left unknown in the device manager (not counting a grumpy thunderbolt docking device (PCI to PCI bridge) which won’t be completely installed until such hardware is connected).

    If I let the deploy finish and run the command with the exact same syntax again from within the full windows user session I some more drivers are installed
    Do you have any suggestions on how to handle this so that it can finish completely during the task sequence?

    Like

    1. I haven’t run across that particular problem, although there have been a couple occasions where I had to contact my HP technical rep to have a softpaq reviewed. They usually can contact the person that authored the softpaq and get it looked at.

      In this particular case, I see sp96977 has been superseded a couple times. The most current chipset softpaq for that model is sp99509 I believe.

      Like

  12. Great article.

    Has anyone had any luck with using a UNC path as the $RepositoryPath value?

    The activity.log file comes up with this error:

    “Cannot process argument transformation on parameter ‘cacheDir’. Cannot convert value “Microsoft.PowerShell.Core\FileSystem::\\server\HPIA-Repov2\HP ProBook x360 440 G1\Repository\.repository” to type “System.IO.DirectoryInfo”. Error: “The given path’s format is not supported.”

    It will actually create the subfolders in the Respository path but won’t get to the stage of actually populating them with the SoftPaqs.

    Setting the path as a mapped network drive letter works OK, but that method unfortunately won’t work very practically in a prod environment in this case.

    Thank you

    Like

    1. This is a bug in the current HPIA release. I’m told this will work in the next revision. I also attempted to map a drive letter, but ran into permissions issues. I haven’t had an opportunity to try and resolve the issue.

      Like

  13. I see in your task sequence you specify /SoftpaqDownloadFolder:”Repository” I read in your post this references a sub folder in the package. Does this mean I have one folder with drivers, hp image assistant, and the repository folder? I have not referenced a folder in this way before so I want to be clear that all I need to do is specify the folder name and not set something else to reference this folder.

    Like

    1. The HPIA files and folders are in the root of the package. The downloaded softpaqs get put in the repository subfolder using the script. Let me know if you have any additional questions.

      Like

  14. Thanks Ryan, great post. I had a question, could you or have you tried a hybrid of method 2 to run in the OS imaging process, storing the softpaqs on a UNC server path and having the task sequence go there. Could this eliminate the need for individual driver packages and creating an OS steps for each model? That could keep the download traffic local and make it so I don’t have to manage SCCM packages. I would think you would just run the cmd as an account that has read/write to the server location. You might be able to use a DFS share to have the same effect as having distribution points. First model of a machine might take some time. What are your thoughts?

    Like

    1. Hello Derryn,

      Yes, you certainly can run a repo from a UNC share. A previous version of HPIA had a bug where UNC didn’t work, but v4.2.4.1 that is now working properly.

      Depending on your connectivity between sites, this could work well. I have never tried the DFS share idea either, but in theory that would also work.

      Like

  15. Hi Ryan,

    This looks great but I have a couple of issues, probably me not understanding it properly!
    Firstly, where can I get the product codes from? I’ve got some from the posts above but am missing them for a few devices.
    Secondly, and more importantly, I can’t get it to work for the devices I do have product codes for!
    I was getting errors about logs similar to ‘Adam’ above, after manually creating the RepoUpdate.log file I no longer get these errors. That log now looks correct with no errors, like this:

    —————————————————————————- 09/12/2019 11:21:36 0 (0x0000)
    Checking if repository for model HP ProDesk 600 G2 aka 805D exists 09/12/2019 11:21:36 0 (0x0000)
    Repository for HP ProDesk 600 G2 does not exist, creating now 09/12/2019 11:21:36 0 (0x0000)
    HP ProDesk 600 G2 HPIA folder and repository subfolder successfully created 09/12/2019 11:21:36 0 (0x0000)
    Repository not initialized, initializing now 09/12/2019 11:21:36 0 (0x0000)
    HP ProDesk 600 G2 repository successfully initialized 09/12/2019 11:21:36 0 (0x0000)
    Set location to HP ProDesk 600 G2 repository 09/12/2019 11:21:36 0 (0x0000)
    Configure notification for HP ProDesk 600 G2 09/12/2019 11:21:36 0 (0x0000)
    Remove any existing repository filter for HP ProDesk 600 G2 repository 09/12/2019 11:21:36 0 (0x0000)
    Applying repository filter to HP ProDesk 600 G2 repository (Win10 1803, bios and driver and firmware) 09/12/2019 11:21:36 0 (0x0000)
    Invoking repository sync for HP ProDesk 600 G2 repository (Win10 1803, bios and driver and firmware) 09/12/2019 11:21:36 0 (0x0000)
    Invoking repository cleanup for HP ProDesk 600 G2 repository for bios and driver and firmware categories 09/12/2019 11:21:36 0 (0x0000)
    Confirm HPIA files are up to date for HP ProDesk 600 G2 09/12/2019 11:21:36 0 (0x0000)
    —————————————————————————- 09/12/2019 11:21:37 0 (0x0000)
    Repository Update Complete 09/12/2019 11:21:37 0 (0x0000)
    —————————————————————————- 09/12/2019 11:21:37 0 (0x0000)

    However, when I go in to the repository no files have downloaded and the activity.log is full of errors like this:

    [2019-12-09T11:21:36.370+00:00] domain\username – Repository initialized succesfully.
    [2019-12-09T11:21:36.402+00:00] domain\username – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    [2019-12-09T11:21:36.417+00:00] domain\username – Error – Failed to modify repository configuration: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.417+00:00] domain\username – Adding ’email@domain.com’ as a recipient.
    [2019-12-09T11:21:36.433+00:00] domain\username – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    [2019-12-09T11:21:36.448+00:00] domain\username – Error – Failed to modify repository configuration: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.464+00:00] domain\username – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    [2019-12-09T11:21:36.464+00:00] domain\username – Error – Could not remove filter from repository: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.480+00:00] domain\username – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    [2019-12-09T11:21:36.495+00:00] domain\username – Error – Could not add filter to repository: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.511+00:00] domain\username – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    [2019-12-09T11:21:36.511+00:00] domain\username – Error – Could not add filter to repository: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.527+00:00] domain\username – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    [2019-12-09T11:21:36.527+00:00] domain\username – Error – Could not add filter to repository: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.542+00:00] domain\username – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    [2019-12-09T11:21:36.558+00:00] domain\username – Error – Repository synchronization failed: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.558+00:00] domain\username – An error occurred during softpaq synchronization.
    [2019-12-09T11:21:36.558+00:00] domain\username –
    [2019-12-09T11:21:36.558+00:00] domain\username – The error was: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.558+00:00] domain\username –
    [2019-12-09T11:21:36.558+00:00] domain\username – Details:
    [2019-12-09T11:21:36.558+00:00] domain\username –

    [2019-12-09T11:21:36.558+00:00] domain\username -
    [2019-12-09T11:21:36.558+00:00] domain\username - ErrorRecord                 : The variable '$_' cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.558+00:00] domain\username - StackTrace                  :    at System.Management.Automation.VariableOps.GetAutomaticVariableValue(Int32 tupleIndex,
    [2019-12-09T11:21:36.558+00:00] domain\username -                               ExecutionContext executionContext, VariableExpressionAst varAst)
    [2019-12-09T11:21:36.558+00:00] domain\username -                                  at loadRepository(Closure , FunctionContext )
    [2019-12-09T11:21:36.558+00:00] domain\username - WasThrownFromThrowStatement : False
    [2019-12-09T11:21:36.558+00:00] domain\username - Message                     : The variable '$_' cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.558+00:00] domain\username - Data                        : {System.Management.Automation.Interpreter.InterpretedFrameInfo}
    [2019-12-09T11:21:36.558+00:00] domain\username - InnerException              :
    [2019-12-09T11:21:36.558+00:00] domain\username - TargetSite                  : Void CheckActionPreference(System.Management.Automation.Language.FunctionContext,
    [2019-12-09T11:21:36.558+00:00] domain\username -                               System.Exception)
    [2019-12-09T11:21:36.558+00:00] domain\username - HelpLink                    :
    [2019-12-09T11:21:36.558+00:00] domain\username - Source                      : System.Management.Automation
    [2019-12-09T11:21:36.558+00:00] domain\username - HResult                     : -2146233087
    [2019-12-09T11:21:36.558+00:00] domain\username -
    [2019-12-09T11:21:36.558+00:00] domain\username -
    [2019-12-09T11:21:36.558+00:00] domain\username -
    [2019-12-09T11:21:36.558+00:00] domain\username - 

    [2019-12-09T11:21:36.636+00:00] domain\username – Error – Could not parse ‘.repository/repository.json’ Cannot convert value “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” to type “SoftpaqRepositoryFile”. Error: “Cannot convert the “@{DateCreated=2019-12-09T11:21:36.355+00:00; DateLastModified=2019-12-09T11:21:36.370+00:00; CreatedBy=domain\username; ModifiedBy=domain\username; Filters=; Notifications=; Settings=}” value of type “System.Management.Automation.PSCustomObject” to type “SoftpaqRepositoryFile”.”
    [2019-12-09T11:21:36.652+00:00] domain\username – Error – Could not initialize the repository: The variable ‘$_’ cannot be retrieved because it has not been set.
    [2019-12-09T11:21:36.652+00:00] domain\username – Beginning repository cleanup
    [2019-12-09T11:21:36.667+00:00] domain\username – Completed repository cleanup, deleted 0 files.

    Hopefully I have missed something obvious! Any help gratefully received 🙂
    Thanks,
    Phil.

    Like

    1. I have not encountered errors like you have listed in your post. At first glance, it may be a file and folder permission issue? Is the account you are running have full modify permission on the folder?

      Like

      1. Also, you can use the script library 1.3 release to use the following to find your platforms. In this example, it will return all the info for models matching 440.

        get-hpdevicedetails -match “440”

        Like

    2. As Ryan says, this screams permissions. Can you try running the script with the repo set on a local folder that you have full control over?

      Like

  16. Hello Ryan and thank you for this write up! When I run this HPIA exits with code 1 which is “The /VerifySoftPaq command returns that the SoftPaq binary verification could not be found.”. I am not using that switch in my command. Thoughts?

    Like

    1. I have not encountered that error. Does the device have access to the internet when running the step? Regardless of whether or not you have a repository previously downloaded, HPIA will always reach out to the internet to download the cab file for each platform.

      Like

      1. Thanks for the reply! That’s a good thought….If it cannot get to the Internet that’s a valid error it might return. Thanks!

        Like

    2. Does a report get created? I know we are doing some work on our softpaq wrapper which has caused use to implement code in HPIA that verifies the hash of the softpaq vs the information in the cva, but i don’t think those softpaqs are live yet. I’d be curious as to what your report says.

      Like

      1. I have it set to create a report but HPIA doesn’t seem to create one. The only report I can see is the 100,000 like log for SCCM, which is fun to look at.

        Like

  17. Hi, thanks for sharing this. I’ve tried to run the PS script to create the file repository but the script errors out on every mention of the term “log” as it’s not a recognized cmdlet or function. It does download the files for the model selected but it doesn’t copy the HPIA files to the package either.

    Any idea please?

    Like

    1. Logging: The logging feature was created by @EphingPosh and is posted at https://www.ephingadmin.com/powershell-cmtrace-log-function/. In my environment, I added this as a separate module, but it could be added to the top of the script as well. This logging is done in CMTrace format for easy readability.

      HPIA Files: Did you download and extract the HPIA files to the ‘HPIA Base’ folder? That is where the robocopy step mirrors from to make sure the HPIA files are up to date. If a newer version of HPIA is released, copying it to the base folder and running the script will update each model repo with the new version.

      Like

  18. Hi Ryan, thanks for sharing this. I run the script and it downloads the files for the model I’ve selected but doesn’t copy the HPIA files into the package. It also errors on the term “log” as it’s not a recognized cmdlet or function. I’ve updated powershell to v5 but still no good.

    Any ideas please?

    Like

    1. Another commenter Jamie had the same question. I copied my reply from that question below:

      Logging: The logging feature was created by @EphingPosh and is posted at https://www.ephingadmin.com/powershell-cmtrace-log-function/. In my environment, I added this as a separate module, but it could be added to the top of the script as well. This logging is done in CMTrace format for easy readability.

      HPIA Files: Did you download and extract the HPIA files to the ‘HPIA Base’ folder? That is where the robocopy step mirrors from to make sure the HPIA files are up to date. If a newer version of HPIA is released, copying it to the base folder and running the script will update each model repo with the new version.

      Like

  19. Hey Ryan, thank you for this write up. I was wondering if you could help with a small issue I bumped into while trying Method 2. I am using a UNC path for my repo and everything is working properly except that I’m prompted for every single install. The message I receive states: “Windows can’t verify who created this file. Are you sure you want to run this file?” Any advice on how to avoid this prompt? Thank you again for sharing this write up.

    Like

  20. Trying to troubleshoot this as mine fails, does anyone know where the log file is stored? I’m using the /debug switch and according to HP documentation it puts the log in the %temp% dir. Dunno how that is affected during OSD.

    Like

    1. I am not sure if you are having issues with the repository update script or the actual task sequence steps.

      The repo update script is logged in a couple of different places. There is a general log for the whole process in the root of the repo called RepoUpdate.log. There is a log for each individual model sync in the .repository folder called activity.log showing what was done for each model repo.

      The task sequence step log is located where you specify with the /ReportFolder option. In my example, I have that sent to a UNC share.

      Like

      1. Hey Ryan, I’m using method 2. I originally was running it using a service account as I’d read that it didn’t work without running it with an account. I took that out and now can confirm it gets so far then bombs out (if I restart the computer the BIOS update finishes). Looking in the SMSTS log the exit code is 8194 which doesn’t mean anything to me. I have added the /debug switch which is supposed to create a debug log which might yield more information however the documentation says it’s placed in the %TEMP% folder. Not sure where that is during OSD?

        Like

  21. Firstly, let me say this site has been great for helping our team move off SDM/SSM to CMSL/HPIA. The most recent versions of each (v1.4.1.1 and v.4.5.4.1) do support offline repo, and it seems to work for the most part. I’m finding I need to run the script several times to get each repo to fully download all the softpaqs for some reason and to properly setup the .repository/cache/offline structure.

    Any way, my main problem now is that even though I am filtering for just bios, driver, and firmware, along with characteristic “ssm”, it still seems to pull down certain “software” softpaqs. I don’t want these installed, and some of them actually break the MDT process. I tried manually removing them from the repo folder along with their “mark” files, but I think they are still listed in the cab files. HPIA freaks out and MDT TS fails.

    How can we ensure the proper softpaqs are downloading? Is there any way the CMSL can be extended to block/remove certain softpaqs? I know we can create Target XML files to reference against, but I don’t want to have to keep a spare computer of every model we support on-hand to constantly build new XML files. It kinda defeats the purpose of the beautiful scheduled script above.

    Like

  22. Great post!

    Trying to implement it, and made it work initially on my test machines the first time. Now im getting an error. Running in debug mode the error is:

    04-03-2020 07:47:25 — Analysis completed
    04-03-2020 07:47:25 — Saving recommendations as HTML started
    04-03-2020 07:47:25 — Saving recommendations as HTML completed
    04-03-2020 07:47:25 — Saving recommendations as XML started
    04-03-2020 07:47:25 — Saving recommendations as XML completed
    04-03-2020 07:47:25 — Exception (Handled): Object reference not set to an instance of an object.
    04-03-2020 07:47:25 — Exiting with exit code: 0

    Seeing this on 2 of my machines – which both worked fine the first time – but after a reinstall, they both fail with this error.

    The error seems to come just when it tries to download updates from the internet. (can see that in the last computer that still works)

    Also running HPIA with GUI, allows me to analyze the computer, but when I select the update I want to install, and press “download” nothing happens…

    They both updated the BIOS, and after that time, they seem to malfunction with the above errors – not sure that it has anything to do with that though…

    Any ideas? Anybody seen this on their setup?

    Like

  23. Hi Ryan, First, thank you for this page. Second, is it possible to use the offline switch with a network repository? I am attempting this but the log file never creates and the script ends almost immediately. Here is the command I’m using

    c:\HPIA\HPImageAssistant.exe /offlinemode:p:\HP ZBook Studio G3 Mobile Workstation\Repository /Operation:Analyze /Category:All /Selection:All /Action:Install /Silent /Reportfolder:c:\hpia\logs /SoftpaqDownloadFolder:\\server\share\HP ZBook Studio G3 Mobile Workstation\Repository

    The server\share does actually exist and is populated. Thanks!

    Like

    1. Yes, the newer releases of HPIA allow for the offline switch in order to have better control over which softpaqs are installed versus always reaching out to HP.com to find the most current. I am guessing you will need to put your paths inside quotes since the paths have spaces. Check out the HPIA line of code about halfway down on this link to see an example.

      https://developers.hp.com/hp-client-management/blog/driver-injection-hp-image-assistant-and-hp-cmsl-in-memcm

      Like

  24. Hi Ryan, quick question about this:

    You mentioned that you’re using HPIA “after the first reboot into the Full OS”. Are you installing any drivers before this step, during WinPE? It’s been my experience with some devices that if drivers (such as the NIC adapter) are not installed during WinPE, the device will no longer have an IP address after it boots into the full OS and tries to continue running the task sequence; at which point it would not be able to download and install the HPIA package from ConfigMgr.

    Like

    1. Hi Danny. Yes, the task sequence runs the HPIA step as the first thing once the full OS boots. We are fortunate that all of our models have a working storage and network driver built into Windows 10, so we don’t have to make any accommodations in WinPE. If you run into an issue where you don’t have a network adapter, the driver will need to be installed in WinPE by either importing into the ConfigMgr database, or injecting by some other method.

      Like

  25. Thank you Ryan for your work.

    Method 1 works fine. With method 2 I have an error. It tells me that the softpaq could not be extracted. I tried with different user which all have full access to the share. Do you have any idea?

    Like

    1. Hello Lorana,

      Occasionally, I have run across softpaqs that have an issue. Being your comment was from 19 days ago, HP may have fixed it by now. Otherwise, you can reach out to your HP reseller and/or technical contact to report a softpaq issue. They are usually fairly responsive.

      Like

  26. Hi, beginner here with a plethora of questions but I’ll ask the most basic first.

    When I try to run the PowerShell script I get the error:

    “The term ‘Initialize-Repository’ is not recognized as the name of a cmdlet, … etc etc”

    Any idea what could be causing it?

    Sorry if this is a dumb question but I would appreciate the help!

    Thanks

    Like

  27. Hello,
    I installed HPCSL version 1.5 today and now I get the message:

    “Directory ‘C:\Users\Administrator\Desktop’ is not a repository.
    In C:\Program Files\WindowsPowerShell\Modules\HP.Repo\HP.Repo.psm1:127 Zeichen:5
    + throw [System.Management.Automation.ItemNotFoundException]”Direct …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : SessionStateException”

    When I install the old version 1.4.3 it works again. What am I doing wrong?
    I hope you can help !! The script helps us a lot in our daily work.

    Like

  28. I’ve got this working now and have deployed as available for our users to run from Software Center when they want. What I would like to do is force the install of the updates but obviously if I just do this normally then when the ethernet and video drivers install it will interrupt their working. Has anyone come up with a clever way of forcing driver updates while minimising user disruption?

    Like

    1. The only thing I can think of would be creating a scheduled task to run this after hours. I have seen people that do creative things such as a scheduled power on within the bios for OS patching. The same approach could be taken here, but likely won’t work as well with laptops versus desktops.

      Like

  29. To get the newest supported OS for your devices you can add the following line to your script:

    $OSVersion = (Get-HPDeviceDetails -Platform $HPModelProdCode -OSList | Where-Object { $_.OperatingSystem -like “*Windows 10*” } | Measure-Object OperatingSystemRelease -Maximum).Maximum

    Like

  30. Superstoked with your Script! But I’m having difficulties applying this in my image… Do you apply this as a final task after a reboot into the “Currently installed default operating system” or should it work just fine with the default boot image from the tasksequence…

    And I can see the wmi query working just fine – which is awesome btw. But alas I’m getting error 0x800700D8 after the packages are downloaded locally… Nothing to show in the logging either :/

    Any clues?

    Like

    1. I have my HPIA steps for each model in a separate task sequence, which I run as the first step when booting into the full OS. HPIA has to run in full Windows, so it will not run within WinPE. Is your error happening in WinPE?

      Like

  31. Hi Ryan,
    Thanks for the great write up and PS script. Everything is working good for me except I noticed that HPIA did not update the Intel graphics driver on my Prodesk 600 G4. So I manually tried and got an error I have seen before when attempting this manually: “The operating system is not supported.” I have found through troubleshooting that the current video driver must be uninstalled and the pc rebooted and then the new graphics driver will install without error. Is there anyway to automate this via HPIA? Has anyone else run into this?

    Like

    1. The only model I have that is a ProDesk is 600 G6. I haven’t seen that occur. SoftPaqs are supposed to be able to accommodate upgrading over the top of previous versions. Was the previous version from HP, included in Windows, or downloaded from Intel? If you are using a task sequence approach like I am, you can complete an uninstall of the previous version if there is a proper silent uninstall provided. It is tougher to automate that because you need a reboot, then have to login again after reboot to continue the sequence I believe.

      If you find things like this, you can email your HP technical contact if you have one. As an education customer, we have a contact assigned to our district that we email with issues.

      Like

  32. Hi Ryan, I like your approach but what if you have different locations with their own DP ? You set a statis unc path in install command but how to use it when you have different locations?

    Like

    1. The UNC path is only where a report gets sent following the command if you need to review later. The content all comes from the package, which is distributed to distribution points as usual.

      Like

  33. I’m trying this via OSD Task Sequence and it works, however during the install process for each driver it finds necessary, it’s popping up a UAC box rather than just running silently…

    Any way to rectify that?

    Thanks for this page by the way! Good work

    Like

    1. As far as I know, each task sequence step should be running as system and no prompt would occur. You aren’t checking the option to ‘Run this step as the following account’ at the bottom of the run command line step?

      Like

  34. Hey Ryan, I’m so thankful I came across this. After some issues I’ve finally gotten things to work in my environment and my guys who do imaging are very happy. No more missing drivers!

    I do have one question. In your script where you have the HP Models table..

    For example:
    @{ ProdCode = ‘8ABB’; Model = “HP EliteBook 840 G9 Notebook PC”; OSVER = 2004 }

    I cannot change the OSVER to anything higher than 2004, if I try to change it to 20H2 for what OS we’re running, it doesn’t like it. I’ve even tried changing it to 21H1. Completely changes it and errors out on me. I think due to this, I cannot find the newest models that we got in.

    Like

    1. Hey Todd,

      I am glad the blog is helpful. I have never experienced issues switching to another OSVER. What version of the CMSL are you using? Perhaps that is outdated and doesn’t accept newer windows 10 builds?

      Like

      1. Looks like the version I have installed is 1.6.5.

        So if I just change the OSVER to 21H1 and try running the script I get the following error:

        21H1 : The term ’21H1′ is not recognized as the name of a cmdlet, function, script file, or operable program. Check
        the spelling of the name, or if a path was included, verify that the path is correct and try again.
        At E:\tools\HPIA\Update_HP_Repositories_for_HPIA.ps1:60 char:74
        + … de = ‘861F’; Model = “HP Elite Dragonfly Notebook PC”; OSVER = 21H1 }
        + ~~~~
        + CategoryInfo : ObjectNotFound: (21H1:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException

        Like

  35. Hi Ryan, We’ve been using your script and method for a few years now, thank you.
    Just recently we’ve noticed it fails with code 8199 “Cannot Download Softpaq”
    We are using the offline repository with this command
    HPImageAssistant.exe /Operation:Analyze /Action:Install /Selection:All /OfflineMode:”Repository” /Silent /Debug /ReportFolder:C:\windows\logs\software\imageassistant /ResultFilePath:C:\windows\logs\software\imageassistant\readme.html /SoftpaqDownloadFolder:”Repository” /BIOSPwdFile:password.bin
    It downloads the repository fine and then on the first install command fails with an exit code of 0 then fails the HPIA with 8199.
    Any ideas?

    Like

  36. Actually it looks like it installs the 1st package (Realtek USB Audio) fine, exits with 0, then HPIA exits with 8199

    Like

  37. Hello Todd,
    I think you need to use quotation marks.
    In my case it’s worked

    @{ ProdCode = ‘8724’; Model = “HP EliteBook 850 G7 Notebook PC”; OSVER = “22H2” }

    Like

Leave a comment