Close Menu
PowerShell.roPowerShell.ro
  • Home
  • Automation
  • Powershell
  • VMWare
  • Windows
LinkedIn X (Twitter) Facebook
PowerShell.roPowerShell.ro
  • Home
  • Automation
  • Powershell
  • VMWare
  • Windows
LinkedIn Facebook X (Twitter)
PowerShell.roPowerShell.ro
Home»Powershell»Update HPE ILO firmware using PowerShell
Powershell

Update HPE ILO firmware using PowerShell

Catalin CristescuBy Catalin CristescuJanuary 2, 2024
Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
The first script of 2024 is about updating the HPE ILO firmware on physical servers using PowerCLI. HPEILOcmdlets
Share
Facebook Twitter LinkedIn Pinterest Email

The first script of 2024 is about updating the HPE ILO firmware on physical servers using PowerShell.

Firmware updates, including those for iLO, often include bug fixes, security patches, and performance enhancements. Regularly updating iLO firmware ensures that your servers are equipped with the latest features, improvements, and security measures, reducing the risk of vulnerabilities and enhancing overall system stability.

The PowerShell Script:

The script is designed to connect to a ILO remote board, iterate through each one, and perform the firmware update as needed.

Just to be noted that it was tested on ILO 5 on more than 200 HPE physical servers.

# 1. Import the HPEiLOCmdlets module
Import-Module -Name "C:\temp\hpeilocmdlets.4.0.0\HPEiLOCmdlets.psd1"

# 2. Declare a variable to use for the connection
$ILOAccount = Get-Credential

# HPE ILO cmdlets connect to iLO
# Reading iLO addresses from a text file
$ILOAddresses = Get-Content -Path "C:\temp\ilotargets.txt"

# Loop through each iLO address
foreach ($ILOAddress in $ILOAddresses) {

    # Establishing a connection to the iLO
    $Connection = Connect-HPEiLO -Address $ILOAddress -Credential $ILOAccount -DisableCertificateAuthentication:$true -Timeout 60 -Verbose

    # 3. Checking the iLO firmware version before updating
    Get-HPEiLOFirmwareVersion -Connection $Connection | Select-Object Hostname, FirmwareVersion 

    # 4. Upgrading the HPE iLO firmware
    $task = Update-HPEiLOFirmware -Connection $Connection -Location "C:\temp\ilo5_300.fwpkg" -UploadTimeout 300 -UpdateRepository:$true -TPMEnabled:$true -confirm:$false

}


 # Loop through each iLO address
foreach ($ILOAddress in $ILOAddresses) {   

    # Reconnect to iLO after the update
    $Connection = Connect-HPEiLO -Address $ILOAddress -Credential $ILOAccount -DisableCertificateAuthentication:$true -Timeout 60

    # 5. Checking the iLO firmware version after updating
    Get-HPEiLOFirmwareVersion -Connection $Connection | Select-Object Hostname, FirmwareVersion

# Disconnect from iLO after completing the updates
Disconnect-HPEiLO -Connection $Connection
}

This script does the following:

  1. Imports the HPEiLOCmdlets module.
  2. Declares a variable for the iLO account credentials.
  3. Reads iLO addresses from a text file.
  4. Connects to each iLO using the provided credentials and addresses.
  5. Checks the iLO firmware version before updating.
  6. Updates the iLO firmware using the specified package.
  7. Reconnects to iLO after the update.
  8. Checks the iLO firmware version again after updating.
  9. Disconnects from iLO after completing the updates.

Feel free to customize this script based on your specific reporting requirements and share your experiences or improvements in the comments below!

It should be noted that the script is not entirely authored by me; certain information and code snippets are sourced from various places, including blogs, GitHub repositories, and community forums.

connect-hpeilo disconnect-hpeilo firmware get-hpeilo HPEiLOCmdlets hpeilocmdlets.4.0.0 iloaddress powercli set-hpeilo
Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticlePowerCLI script to check Cluster Overcommitment ratio
Next Article Tagging Virtual Machines with the CISTag Module in PowerShell
Catalin Cristescu
  • Website

Related Posts

Automation

PowerShell script for automated remediation for CrowdStrike issue

July 20, 2024
VMWare

vExperts stats 2024

May 27, 2024
Automation

Tagging Virtual Machines with the CISTag Module in PowerShell

February 1, 2024

2 Comments

  1. John on January 3, 2024 6:02 pm

    Just curious but where is the PowerCLI in this script?

  2. admin on January 5, 2024 7:36 am

    Just a mistake into the article, I`ve corrected it. After i have published the article i saw that i was used the PowerCLI instead of Powershell, since no PowerCLI module was used :))

    Thanks for your attention.

Recent Posts
  • PowerShell script for automated remediation for CrowdStrike issue
  • vExperts stats 2024
  • Tagging Virtual Machines with the CISTag Module in PowerShell
  • Update HPE ILO firmware using PowerShell
  • PowerCLI script to check Cluster Overcommitment ratio
Categories
  • Automation (11)
  • Powershell (14)
  • Uncategorized (1)
  • VMWare (15)
  • Windows (2)
About Powershell.ro

Powershell.ro, the ultimate hub for tech enthusiasts! Dive into expert-written articles on PowerShell scripts, VMware, automation, Microsoft technologies, and DevOps practices. Unlock tips, tutorials, and solutions designed to empower IT professionals and boost your skills in automation and infrastructure management.

Recent Posts
  • PowerShell script for automated remediation for CrowdStrike issue
  • vExperts stats 2024
  • Tagging Virtual Machines with the CISTag Module in PowerShell
  • Update HPE ILO firmware using PowerShell
  • PowerCLI script to check Cluster Overcommitment ratio
LinkedIn
© 2025 PowerShell.ro.

Type above and press Enter to search. Press Esc to cancel.