Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / PowerShell / HP ILO Management Using PowerShell

June 2, 2014 PowerShell

HP ILO Management Using PowerShell

Recently Hewlett-Packard has issued a set of 110 PowerShell cmdlets allowing Windows administrators and IT professionals to remotely configure and manage HP ILO interfaces on HP servers from Windows systems. This set of cmdlets is called HP Scripting Tools for Windows PowerShell and designed to work with HP iLO 3 and iLO 4. The cmdlets are united into HPiLOCmdlets module and meant for:

  • Search and scan ILO interfaces in the network
  • Access to ILO settings, including: ip settings, ILO users, power management, logs, IML, etc.
  • Ability to manage several iLO boards simultaneously

You can download HP Scripting Tools for Windows PowerShell here. Choose the version and bitness of your system (Windows 7 SP1, Microsoft Windows 8, Microsoft Windows Server 2008 R2 SP1 and Microsoft Windows Server 2012 /R2 are supported) and download the corresponding package (by the time this article had been written, HP Scripting Tools Version 1.1 – 20 Mar 2014 was available).

manage hp ilo cards with powershell

In our example it is the package for Windows Server 2012 R2 –Z7550-10537-x64.exe (479 KB). Unpack the contents into any folder and start the installation of HP Scripting Tools for PowerShell (HPiLOCmdlets-x64.msi).

Note. To make the cmdlets work, you should have Microsoft Management Framework 3.0 (with PowerShell 3.0) or Microsoft Management Framework 4.0 (PowerShell 4.0) installed on your computer. PoSh 3.0 also needs .NET 4.0 to be installed, and PoSh 4.0 – NET 4.5.

The module is installed to C:\ProgramFiles\Hewlett-Packard\PowerShell\Modules folder, but the path to this directory is not indicated in the system variable PSModulePath. So, by default, PowerShell does not see this module. Let’s fix that with the following command:

$env:PSModulePath+=";$env:ProgramFiles\Hewlett-Packard\PowerShell\Modules"

Tip. This change is valid only in the current PowerShell session.

You can display the full list of PowerShell HP cmdlets (110 cmdlets) as follows:

Get-Command *HP*

full list of hp ilo cmdlets

Using these cmdlets, you can get the status and manage a lot of ILO board settings on the HP servers: e. g., manage power supply, booting order, UID light, obtain information on the HP ILO version, update firmware, etc.

You can get the information on the meaning, arguments and samples of any cmdlet usage by running the following command:

help  -Full

Firstly, let’s introduce the cmdlet that allows to find HP ILO interfaces in the network. It can take both an actual IP address and a range of IP addresses as an argument:

Find-HPiLO 10.100.200.138
Find-HPiLO 10.100.200.138-141

Powershell - network scan hp ilo cards

In our example, when scanning the range of IP addresses, we found 3 interfaces of ILO v3 installed on HP Proliant DL 360 G7 servers.

Note. You won’t be able to specify the DNS name in the command, because the cmdlet doesn’t support the name resolution.

Not to specify it each time, let’s store ILO IP address, name and password of the user, who has access to the ILO console, in the corresponding variables:

$srvILO = Find-HPiLO 10.100.200.141

$username='Admin'

$password='ILOPa$w0rd'

Let’s try to find out if the power on the server is on:

Get-HPiLOHostPower -Server $srvILO -Username $username -Password $password

 hp ilo board : get status posh

As we can see, the server is on (HOST POWER : ON).

To turn the HP server on using the ACPI interface, run the command:

Set-HPiLOHostPower -Server $srvILO -Username $username -Password $password -HostPower "No"

powershell - turn on power on hp servers

You can switch on the server remotely as follows:

Set-HPiLOHostPower -Server $srvILO -Username $username -Password $password -HostPower "Yes"

Let’s write a small script that takes the settings from a CSV file and switches all HP servers on the list on/off.

The CSV file contains IP address of a server, user name and password, necessary power status on the server. The format of the ILO.csv  file is:

Server,Username,Password,HostPower
10.100.200.160,Admin, ILOPa$w0rd,Yes
10.100.200.162,Admin, someILOword,No

The next PoSh script follows this list and switches power supply of all servers on or off as necessary:

$path = ".\ILO.csv"
$file_csv = Import-Csv $path
$p_ilo = Set-HPiLOHostPower -Server $file_csv.Server -Username $csv.Username -Password $file_csv.Password -HostPower $file_csv.HostPower
$p_ilo | Format-List
$p_ilo = Get-HPiLOHostPower -Server $file_csv.Server -Username $file_csv.Username -Password $file_csv.Password
$p_ilo | Format-List

Now let’s try to remotely switch on the UID control (blue) on the server. Firstly, find out the current UID control status:

Get-HPiLOUIDStatus -Server $srvILO -Username $username -Password $password

Turn it on:

Set-HPiLOUIDStatus -Server $srvILO -Username $username -Password $password -UIDControl "Yes"

powershell turn off/ turn on UID on HP servers

Now try to change the boot order of the server. Get information on the current settings of the boot priorities:

Get-HPiLOOneTimeBootOrder -Server $srvILO -Username $username -Password $password

Let’s change the boot order of the HP server, having specified a CDROM as the first device to boot from:

Set-HPiLOOneTimeBootOrder -Server $srvILO -Username $username -Password $password -Device "CDROM"

hp server manage boot order with powershell

Mount the necessary iso image to the virtual CDROM:

Mount-HPiLOVirtualMedia -Server $srvILO -user $srvILO -pass $password -Device CDROM -ImageURL ‘http://isosrv1.woshub.com/iso/windows2012r2.iso’

You can dismount the image as follows:

Dismount-HPiLOVirtualMedia -Server $srvILO -user $srvILO -pass $ password -Device CDROM

We have considered only basic examples of using the HPiLOCmdlets module, but as you can already notice, the set of cmdlets HP Scripting Tools for Powershell can make the tasks of a system administrator much simpler allowing to automate everyday tasks while working with HP servers.

8 comments
1
Facebook Twitter Google + Pinterest
previous post
How to create a UEFI bootable USB flash drive for install Windows 8 / Server 2012
next post
Java Settings Management with Group Policies

Related Reading

Configure Network Settings on Windows with PowerShell: IP...

March 24, 2023

Exchange Offline Address Book Not Updating in Outlook

March 21, 2023

How to Restore Deleted Users in Azure AD...

March 16, 2023

Send-MailMessage: Sending E-mails with PowerShell

March 14, 2023

Clear Cache and Temp Files in User Profiles...

March 13, 2023

8 comments

Jeffrey Snover June 3, 2014 - 5:11 am

Very nice stuff. I can’t want to get a demo of this in person…. or video – do you have a video demo of this?
Again – it looks great.

Cheers!
Jeffrey Snover[MSFT]
Distinguished Engineer and Lead Architect for Windows Server and System Center

Reply
MaxB June 3, 2014 - 7:42 am

What do you want to see on this video?
Screenshots are made in the productive environment – all so clear…

Reply
Bob September 12, 2014 - 8:59 pm

I liked your post on the HP tools for ILO. I have two requests / Questions.

1. I ran the Find-HPiLO then IP address range. It executes says it may take a while but then does nothing and finds nothing. Suggestions?

2. I need to turn ILO on for maybe half our environment, add a user and password for the boxes in ILO and finally give it an ILO IP address. Even if in baby steps; do you have powershell scripts for this?

Thanks,

Reply
Max September 17, 2014 - 2:03 pm

Remember these PoSh cmdlets work only with HP iLO v3 and v4…

1. Try to run Find-HPiLO from the same subnet, which contains ILO interfaces.. The problem persists?
2. You can’t change ILO IP address using cmdlet Add-HPiLOUse.

Reply
Kiran June 9, 2016 - 11:13 am

please can we have a script to reset the password for ‘x’ number of servers and then create a new user on each servers with a standard password 

Reply
Kiran June 17, 2016 - 11:30 am

Hi I need to create a common account to multiple ILOs with below access , can someone please assist me on that .
1).I have a notepad file with list of ILOs that needs a new account created in all the ILOs , a common username and password needs to be used
 
 

Reply
Mukesh November 10, 2017 - 6:37 am

Hi Team,
We usually use a jump box server to login to other ILO machines for troubleshooting.
I want to use this to fetch the Server logs and other health related data.
Where shall I install it in Jump box ?

Thanks.

Reply
JamD November 17, 2017 - 5:11 am

You must download and install module “HP Scripting Tools for Windows PowerShell” on your jump box server

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Run Program without Admin Privileges and Bypass UAC Prompt?

    March 24, 2023
  • Configure Network Settings on Windows with PowerShell: IP Address, DNS, Default Gateway, Static Routes

    March 24, 2023
  • Exchange Offline Address Book Not Updating in Outlook

    March 21, 2023
  • Attaching Host USB Devices to WSL or Hyper-V VM

    March 20, 2023
  • Sending an E-mail to a Microsoft Teams Channel

    March 17, 2023
  • How to Restore Deleted Users in Azure AD (Microsoft 365)?

    March 16, 2023
  • Fix: Remote Desktop Services Is Currently Busy

    March 15, 2023
  • Send-MailMessage: Sending E-mails with PowerShell

    March 14, 2023
  • Clear Cache and Temp Files in User Profiles on Windows (RDS) with PowerShell and GPO

    March 13, 2023
  • Prevent Users from Creating New Groups in Microsoft 365 (Teams/Outlook)

    March 6, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top