Resetting ILO Password from ESXi host using PowerCLI

Occasionally things go wrong and you end up in a situation where the ILO password has been set to somthing unknown or the password has been lost through time. This PowerCLI script utilises Posh-SSH to reset the ILO Administrator Password from the ESXi OS.

Dependencies for this script are
Posh-SSH Module Installed.
Windows Managment Framework up at a minimum of v5.
HP Customized iso used to install host or HP Managment bundles installed post ESXi Install.

The script basically creates an XML file to reset the password
SCP copies the file to the host and then runs “hponcfg” to apply the formatted XML file to the ILO.

It can be modified to apply any XML for ILO configuration quite easily.

Usage : Connect to the vcenter hosting the ESXi host with connect-viserver and run the script.

the manual Process would be to create a xml file with the contents by either using an editor on the host and or uploading via SCP to the host

and then SSH to the host and run the following