mercoledì 24 aprile 2019

How to download drivers (HP softpaqs) using Powershell script


first you have to download HP Client Management (Powershell) Script library from https://ftp.hp.com/pub/caps-softpaq/cmit/hp-cmsl.html

after you installed the script , you have to create a folder where you want to save the softpaq.

example I create C:\SoftpackRepository

then I create a folder with the model name of my computer:
md C:\SoftpackRepository\Elitebook_840_G5
cd C:\SoftpackRepository\Elitebook_840_G5

in order to set this folder as a softpaq repository:
Initialize-Repository

it creates a subfolder .repository

now I have to add the model , providing sysID , OS and softpaq catergories I want o download

Add-RepositoryFilter -platform 83B2 -os win10  -osver 1809  
or
Add-RepositoryFilter -platform 83B2 -os win10  -osver 1809  -catogory driver
or
Add-RepositoryFilter -platform 83B2 -os win10  -osver 1809  -catogory BIOS
or
Add-RepositoryFilter -platform 83B2 -os win10  -osver 1809  -catogory firmare 
(see documentation for categories list , it will change. link https://developers.hp.com/hp-client-management/doc/softpaq-repository )

if you (john.doe@acme.com@acme.com) want to be informed if something goes wrong during softpaq download set these two parameters

Set-RepositoryNotificationConfiguration -server "smtp.acme.com" -username john.doe@acme.com  -password "your_passwor" -from "softpaq-repo-sync@acme.com" -fromname "SOFTPAQ REPOSITORY NOTIFICATION" 
Add-RepositorySyncFailureRecipient -to john.doe@acme.com@acme.com  

these settings are saved in .repository\repository.json file

once the setting is done, just run
Invoke-RepositorySync 

if after some weeks you want to update your folder
do these:
cd C:\SoftpackRepository\Elitebook_840_G5
Invoke-RepositorySync 

if you want to remove obsolete softpaq or softpaq not matching the filters written in repository.json

cd C:\SoftpackRepository\Elitebook_840_G5
Invoke-RepositoryCleanup
.
you can repeat all steps for several models or read my next post about how to do it in a loop

how to flash the BIOS to a Remote PC (HP Businnes PC) using a client management tool

it's very simple to flash to BIOS of a remote PC if you have client management tool able to send a simple Powershell script to the HP Business PC.

Remote PC must have installed HP Client Management script library (https://ftp.hp.com/pub/caps-softpaq/cmit/hp-cmsl.html)

I have an HP Elitebook 840 G5 on my hands
using Get-HPDeviceProductID I got 83B2

if you already know the sysID of your PC, you can send a Powershell script with these two lines, from management console to your PC.

Get-hpbiosUpdates -platform 83B2 -download -saveas bios.bin ; 
Update-HPFirmware -file bios.bin -bitlocker suspend ; 

at next reboot or power on , the BIOS flash starts automatically and the user can't interrupt it unless user power off the PC.

you need to advice the user before to start a BIOS update, just to avoid him/her to block the update.

bitlocker must be restarted once Windows is running , sending another Powershell cmdlet


I tried for example with Absolute Software (even sold by HP) , which is able to send a script over Internet. It worked.

bye

martedì 23 aprile 2019

How to update the BIOS of PC over the network , "on premise" solution

in this post I explain how to update the BIOS of PCs in intranet without requiring the PC to access internet to get BIOS file.

I know several methods to update the BIOS of an HP Business PC. in this post I just describe how to update the BIOS of PC running Windows 10 , BIOS in UEFI mode and disk with GPT partition scheme.
I doesn't work if disk has MBR partitions in legacy mode.
as usual you need Powershell HP Client Management Script Library form here https://ftp.hp.com/pub/caps-softpaq/cmit/hp-cmsl.html , download and install the package on you management console. 
Run a second time the installation package and extract the HP modules in  C:\SWSetup\ps1.2\

As the script I wrote needs to access Windows Remote Management (WinRM) service running on the remote PC , the management console user must have the right to access  WinRM service of the remote PC and be able to run an invoke-command on remote PC.

The script does these actions:
  1. verifies that  management console user is able to access WinRM of remote client, otherwise exit
  2. creates an array of HP computers with these information:
    1. model name , is a string of your preference
    2. system ID , exadecimal number  , used to identify the model
    3. bios version, must match the format returned by HP cmdlet get-HPBIOSVersion
    4. bios file name 
    5. you have to manually create this list or you can create it using another PS script.
    6. example : ("840G5","83b2","1.06.00","Q78_010600.bin") , more in the script
  3. gets information from remote PC: Model string , SysID and BIOS version
  4. compares sysid and BIOS version with values written in the array.
  5. if PC sysid is not found in array list , exit
  6. if PC is found , BIOS version read from PC is compared with BIOS version in the array; if they match , exit
  7. if BIOS versions are different , overwrite (update) the BIOS version of remote PC
  8. HP PS scripts and BIOS.bin files are copied from management console to remote PC folder 
  9. an invoke-command will execute cmdlet UPdate-HPFirmware on remote PC 
  10. BIOS will be update at next reboot. user can't interrupt it

in order to have this script working, you must have on management console all BIOS files of your model.
you can use the script on my other post "How to quickly download the BIOS of your HP Business PC". both script must have the same model string.

this is my script

end of the scipt

lunedì 22 aprile 2019

How to update the BIOS of a PC over the network , from HP site

few people update the BIOS of their PCs but it's a best practice do it regularly.

there are several reasons for a BIOS update: improve security , remove BIOS bugs , add features

I know several methods to update the BIOS of an HP Business PC. in this post I just describe how to update the BIOS of PC running Windows 10 , BIOS in UEFI mode and disk with GPT partition scheme.
I doesn't work if disk has MBR partitions in legacy mode.

as usual you need Powershell HP Client Management Script Library form here https://ftp.hp.com/pub/caps-softpaq/cmit/hp-cmsl.html , download and install the package on you management console.
run a second time the installation packege and extract the HP module in  C:\SWSetup\ps1.2\
As the script I wrote need to access Windows Remote Management (WinRM) service running on the remote PC , the management console user must have the right to access  WinRM service of the remote PC and be able to run an invoke-command on remote PC.

The script do there actions:

  1. verifies that  management console user is able to access WinRM of remote client, otherwise exit
  2. reads remote computer model, sysID , BIOS version
  3. reads on HP web site which is latest BIOS version available for the remote PC sysID
  4. if PC already has latest BIOS version, exit
  5. if BIOS is not latest
    1. powershell scripts are copied from management to remote PC
    2. BIOS for remote PC is downloaded on the PC it-self
    3. if volume is encrypted with bitlocker, it will be suspended
    4. a BIOS update in scheduled on the remote PC
    5. update will happens at next reboot
bitlocker must be resumed after BIOS update.

script doesn't check if BIOS is really updated. you can use another cmdlet to check current BIOS version of remote PC such as get-HPBIOSVersion -target $ip_address

this is my script , copy&paste into a .ps1 file.


bye
Franco

venerdì 19 aprile 2019

How to quickly download the BIOS of your HP Business PC

This article explain how easy is to download latest BIOS of your PC

install HP Powershell Client management Script library as explained here:
https://bellalavitait.blogspot.com/2019/04/how-to-find-bios-versions-available-for.html

then in an Administrator Windows Powershell run:

  • get-hpbiosUpdates  -download
bios file will be saved in current folder using his original name , example Q78_010600.bin

if you want to change name

  • get-hpbiosUpdates  -download -saveas my_preferred_bios.bin
if you want to download a BIOS of another product, just add -platform XXX  ,where XXXX is the system ID (see previous post)

  • get-hpbiosUpdates  -download -platform 8414
  • get-hpbiosUpdates  -download -platform 8414 -saveas X2_1013_G3.bios
in case you want to download latest BIOS for several models , then you need a script like the one just below




script can be modified , removing from the list the models you aren't managing and adding what you need.
Create your own main folder. Then create a folder called "bios"
By default the script creates a new folder for each model in "bios" folder. The folder is named with the string written in the script. binary file is save inside the folder
























example of model list included in the script
[string[][]]$HPcomputer = @(
("430G6_1809","8536"),
("440G6_1809","8537"),
("450G6_1809","8538"),
("645G3_1809","823a"), 
("X2_612_G2_1809","828b"), 
("X2_1012_G2_1809","82CA"),
("X2_1013_G3_1809","8414"),
("1030G2_1809","827D"),
("1030G3_1809","8438" ),
("1040G3_1809","80FA"),
("1040G4_1809","8417"),
("1040G5_1809","8470"),
("1050G1_1809","84E9"),
("840G3_1809","8079"),

I hope this can help you.

then if you want to update the BIOS of your PC , after you got the BIOS bin file, run

  • Update-HPFirmware -file bios.bin -bitlocker suspend

bitlocker suspend is useless if your hard disk is not encrypted with BitLocker

next post will be about how to update the BIOS of a remote computer., using HP CMS library

Bye
Franco

How to find BIOS versions available for HP Business PC


How to find BIOS versions available for HP Business PC


I'm not a Powershell expert , I do most of the scripts surfing the Internet to see what to others do.
In this post I explain how to use HP CMS library (CMS stands for Client management Script) to discover for a single computer or for a list of computer models which is latest BIOS version available from HP or the full history.

For HP Business PC I mean all notebooks , desktop, All-in-One, Slice , mobile workstation , desktop workstation produced by HP using an HP developed BIOS. so those HP CMS scripts don't work on HP consumer PCs or entry level business PC using a non-hp BIOS.

a list of products that should work with these HP CMS scripts could be this

  • Probook 400 and 600 series
  • Prodesk 400 and 600 series
  • Elitebook 700 , 800 and 1000 series
  • EliteDesk 700, 800 and 1000 series
  • mobile workstation zbook
  • Desktop workstation Z
some scripts works only with Windows 10 starting from 1709 version with BIOS set in UEFI mode.
As I'm able to check every single model and Windows 7 in legacy mode, it's up to you to try if you have older computers.

Powershell minimum version required is 3.0. I use version 5.


In this post I cover just an argument

steps:
  1. download the HP CMS library from here https://ftp.hp.com/pub/caps-softpaq/cmit/hp-cmsl.html
  2. install them
  3. open a Administrator Windows Powershell
  4. if needed change the security setting about PS script execution using this command
    • set-executionpolicy unrestricted
  5. then execute one of these  :
    • get-hpbiosUpdates
    • get-hpbiosUpdates -format csv
    • get-hpbiosUpdates -format list
    • get-hpbiosUpdates -format json

you will discover how many BIOS versions are available for your HP computer.
if you want to now only latest version available today , just add -latest to the above cmdlet

  • get-hpbiosUpdates -format list -latest
if you want to now the BIOS history of another model , add -platform XXXX to the above commands. XXXX stands for the exadecimal number that identify an HP motherboard. for example for HP Elite X2 1013 G3, the sys ID is 8414
you can discover sysID in various way. Using HP CMS , run this command to know sysID
on your computer run:

  • get-HPDeviceProductID
    • result is a 4 digit exadecimal number such as 83B2 if you have an Elitebook 840 G5
you can discover sys ID of a HP computer in your network using :
  • get-HPDeviceProductID - target host_name or IP_address
  • get-HPDeviceProductID -target 192.168.1.35
    • 8414
then you can have the BIOS history of 8414
  • get-hpbiosUpdates  -platform 8414
output will be


now , what if you want to know latest BIOS version of a known computer list ? 
you have to create the list, including model name and sys ID and run the command for each model.
I created a script for these purpose.
The script includes the list and the functions needed to do the work for you



this is the formatted output
PS C:\SoftpaqRepository1.2> .\create_bios_list.ps1


you can modify the script at your convenience.

bye
Franco