The following can be used to set a secure ILO password, which is useful for new HPE ProLiant servers.
This relies on the HPE PowerShell commandlets available here: PowerShell-ProLiant-SDK/HPEiLO/3.0 at master · HewlettPackard/PowerShell-ProLiant-SDK · GitHub
Create a file called ilo.csv with headers “IP,Username,Password”. Store the current IP addresses of the ILO in the file, along with the current ILO username and password.
$inputcsv = import-csv ilo.csv
foreach ($ilo in $inputcsv)
{
write-host Connecting to $ilo.IP
$connection = Connect-HPEiLO -IP $ilo.IP -Username $ilo.Username -Password $ilo.Password -DisableCertificateAuthentication
$pword = ([System.Web.Security.Membership]::GeneratePassword(20,4)).replace(";","-")
write-host $ilo.IP $pword
Set-HPEiLOUser -Connection $connection -LoginName Administrator -NewPassword "$pword"
Disconnect-HPEiLO $connection
}
