Update your HPE iLO device Firmware using PowerShell

This is a quick post on how to update your HPE iLO devices using PowerShell.

First create a simple .csv file in Excel called HPEServers.csv and create a column called ServersiLO.  Here list all your iLO devices by IP or DNS name.

Now we want to check the existing versions and see what needs updating.  Run the below commands to do this:

# check the iLOs versions
$InputFile = "C:\Temp\HPEServers.csv"
$MyHPEFile = Import-CSV $InputFile
$credential = Get-Credential

foreach ($HPServer in $MyHPEFile) {
    $Server = $HPServer.ServersiLO
    $connection = Connect-HPEiLO -Credential $credential -DisableCertificateAuthentication -IP $Server
    Get-HPEiLOFirmwareVersion -Connection $connection
} 

 

Now we want update the firmware, download the firmware .bin file and put it in the location of the input file.  Then just run the code below to update the iLOs

# update the iLOs
$firmwareFile = "C:\Temp\iLO5\ilo5_230.bin"
$InputFile = "C:\Temp\HPEServers.csv"
$MyHPEFile = Import-CSV $InputFile
$credential = Get-Credential

foreach ($HPServer in $MyHPEFile) {
    $Server = $HPServer.ServersiLO
    $connection = Connect-HPEiLO -Credential $credential -DisableCertificateAuthentication -IP $Server
    Update-HPEiLOFirmware -Connection $connection -Location $firmwareFile -Confirm:$false
}

 

You will now need to run this command before your code to use TLS 1.2:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

2 Replies to “Update your HPE iLO device Firmware using PowerShell”

  1. Hi im sorry but this only runs the first server in the CSV no more. What is the $hpserver variable referring to? I dont see it named anywhere else.

Leave a Reply

Your email address will not be published. Required fields are marked *