Before you start for the HP G5 Dock, you will need:

  1. the HP Dock Accessory WMI Provider installed on the computer, and
  2. the computer connected to the dock.

You can then query the dock using

  • WMIC
    wmic /namespace:\\root\HP\InstrumentedServices\v1 path HP_DockAccessory GET ProductName
  • PowerShell
    $HPDockWmi = Get-WmiObject -Class HP_DockAccessory -Namespace root/HP/InstrumentedServices/v1 -ErrorAction Stop

What can go wrong?

  • If you don’t have the HP Dock WMI Provider installed, you’ll get an error.
  • If you don’t have a dock connected, the WMI query will return NULL.

If it works, you’ll see this sort of information

ProductName            : HP USB-C Dock G5
Publisher              : HP Inc.
SerialNumber           : 5CGxxxyyy
State                  : 0
PSComputerName         : NODDYLAND
FirmwarePackageVersion :
MACAddress             : 64:C9:01:EE:FF:DD

HP Firmware Installer for Docks
Complete WMI query guide with WMI Explorer, Powershell, CMD
Reddit: Deploying HP Softpaq via Windows Update/SCCM/Patch Manager/etc…