Using HP iLO Scripting Tools for Windows #PowerShell MT @GetScripting podcast @PowerScripting

PS:> Get-Podcast |? {($_.Name -eq “Get-Scripting” -or $_.Name -eq “PowerScripting”)} | % Get-HPiLO | Format-Audio


Have you ever looked for an item that you set down somewhere and you just can’t find it despite a good thorough search? Then later (once you’ve given up), you practically trip on that very item or it just comes and hits you right in the head! Serendipity is quite a thing!

A lot of the cool tools (i.e. solutions to challenges) come to me in a similar way. Often times via an unexpected tweet, podcast, webinar or a face to face encounter I discover a ‘new to me’ resource that can be leveraged to accomplish a particular task that I’ve been mulling over.

It happened again the other night on the way home after some late night vBrownBag LATAM prep work. I was catching up on my holiday backlog of podcasts. As I drove I listened to Episode 37 (Jingle Bells edition) of the Get-Scripting Podcast hosted by AlanRenouf and JonathanMedd.

[Update]: In the time between when I drafted this post and when I am publishing it, the same topic was also discussed on another podcast that I listen to. Not only was it mentioned in Episode 259 of the PowerScripting Podcast hosted by Jonathan Walz and Hal Rottenberg, the guest was in fact the creator of the tool, Jeff Galloway from HP (bonus: the first segment of this episode captures some awesome DSC tech chat).

Jeff along with his intern developed and released the HP Scripting Tools for Windows PowerShell Configuration cmdlets for iLO3 and iLO4 available for download at

A bit of  quick Googling showed that @ShayLevy has posted some notes along with a link to the  21-page user guide and @RuddyVCP wrote a post about the same topic. (Surely there are others, see note at end).

So, what problems does this solve?
Earlier in the week I had a customer ask if I knew of some way to perform a particular configuration task on HP servers that currently required they perform a host powercycle to boot from a utility ISO. Since it was a VMware ESXi host I suggested the use of HP’s provided esxcli extensions, though they do require you to either have installed the vendor specific custom ESXi ISO (Do you BTW?) or add the individual VIBs to the host, which can be done via interactive installation of the offline bundle(s) or slipped into your own custom built image. With the tools in place, one could even use the Get-EsxCLI() ‘trick’ to interact with the HP utility from PowerShell/PowerCLI, if that’s how you roll. Regardless, it required something the customer didn’t already have in place and would have to add to each host in order to use it.

Hearing about these new HP iLO Scripting Tools for Windows PowerShell made me think that this customer could potentially leverage them to perform the task they needed to do without having to install anything on their hosts.

These HP Cmdlets open up a lot of possibilities and makes them readily accessible from within a familiar PowerShell environment. There are 110 Cmdlets including a number of Get-properties, based on the results one which one could then take another action such as; Set-x, Reset-x, Start, Clear, Disable, Mount, etc.

What can it do?

A very simple example would be to search for servers with iLO on a particular subnet or IP range and then retrieve the status of each.

In a Test/Dev lab with several G7 and G8 servers this simple script was a quick way to check the status of all of them in one quick pass.

$iloIP=Find-HPiLO $iLoSubnet|Select IP
Get-HPiLOVMStatus -Server $iloIP -user $usr -pass $pass|Select Hostname, Status_Message

get ilo status

What else can it do?

Another simple workflow might be to discover iLO, Mount an ISO, set onetime boot media, and then issue a power on or reset to initiate an OS installation.

$iloIP=Find-HPiLO $iLoSubnet|Select IP
$isourl =”http://webserver.lab/dir/provstart.iso

Dismount-HPiLOVirtualMedia -Server $iloIP -user $usr -pass $pass -Device CDROM
Mount-HPiLOVirtualMedia -Server $iloIP -user $usr -pass $pass -Device CDROM -ImageURL $isourl

Get-HPiLOOneTimeBootOrder -Server $iloIP -user $usr -pass $pass | Select BOOT_TYPE
-Server $iloIP -user $usr -pass $pass -Device “CDROM”

Get-HPiLOHostPower -Server $iloIP -user $usr -pass $pass
Set-HPiLOHostPower -Server $iloIP -user $usr -pass $pass -HostPower “Yes”

Dismount-HPiLOVirtualMedia -Server $iloIP -user $usr -pass $pass -Device CDROM

Although we are not necessarily using the Host Power off ( i.e. “No”) option in this example, it may prudent to observer that there is a note in the user guide that explains:
“Whether a server turns off or not when using Set-HPiLOHostPower depends on the operating system power button setting and state of the system. The operating system may ignore a power off request using this command.
To force power off, use the Set-HPiLOVirtualPowerButton cmdlet with parameter –PressType HOLD.

Tying these pieces together, these steps could be integrated as part of a bare-metal deployment in which, your boot media were used to kick off a (fully automated) OS install process.

What’s holding you back? 

How might you use these tools in your environment?
Let others know by leaving a comment, tweet or blog post, I’ll gladly add a link to it right here.

Some final notes:

You may have noticed above that rather than piping the results of a find-hpilo into get-hpilo cmdlet I had to use a variable. This is because for some reason the object(s) returned from the find cmdlt are somehow not consumable by get-hpilo so instead I grabbed the IP(s) and used that in place. This is something that  @RuddyVCP noted in his post about the same topic. Mr. Ruddy also pointed out that he hopes (as do I) that HP plans on leveraging the standard PowerShell credential parameters in a future release instead of forcing a username/password with each use of the cmdlet. In the Power-Scripting interview, Jeff stated that his manner of handling credentials was a design decision that was made in consideration of the fact that iLO can actually perform its own authentication against LDAP / Active Directory. Supporting both would be ideal.

Regardless of these small issues, these new HP supported PowerShell cmdlets are much easier and every bit as powerful as using the HP RIBCL for scripting iLO operations from Windows OS. Don’t believe me? Have a look here: (Makes you want to hug Jeff & his intern, doesn’t it!).

I won’t spoil the entire podcast episode for you, but if you do give it a listen you’ll hear about a few additional enhancements to be released in version 1.1, hopefully coming out in early March. When it does, I’ll do my best to get another post out or update this one.

PowerShell or PowerCLI Fanboy?

If you are, then you might have noticed the logos I cobbled into the image above. Thank Alan for providing these cool logos to the community in full res downloadable format on his website.

If you didn’t catch the inline links above, I can’t recommend these podcasts enough:


7 thoughts on “Using HP iLO Scripting Tools for Windows #PowerShell MT @GetScripting podcast @PowerScripting

  1. I need to know if there is a way to reset the password of the ILO administrator account via powershell, not knowing what the current is?

    Also, is there a way to do this for all my servers at once, instead of doing it one-by-one?

    We are currently using the Powershell cmdlet —- reset-HPiLOAdministratorPassword

    • You can return them all to factory settings using Set-HPiLOFactoryDefault, but this also requires username and password.

      To answer your next question and some things alluded to in the original blog post,the cmdlets including Reset-HPiLOAdministratorPassword can take arrays of parameters and operate on them all at once. They use multithreading to do this to make it less time consuming to run commands against multiple iLOs. For information about doing this see the User Guide. There you can see several examples of how to use parameter or object arrays including piping output from one command to another. The User Guide shows piping the results of Find-HPiLO and adding Username and Password members to the returned objects and finally piping it to Get-HPiLOFirmwareVersion to retrieve the firmware versions of the found iLOs. The example looks like this and has typical output in the User Guide also.

      Find-HPiLO -Verbose |
      % {Add-Member -PassThru -InputObject $_ Username admin}|
      % {Add-Member -PassThru -InputObject $_ Password admin123}|
      Get-HPiLOFirmwareVersion -Verbose

      Find is returning an array of objects, Add-Member is adding Username and Password members to each object and Get-HPiLOFirmwareVersion is using three of each of the object members of each object in the array (IP, Username and Password) and returns an array of objects that have firmware version information from the iLOs found using Find-HPiLO. The cmdlets use object property name matching to extract the required parameters from any object that is piped in. Another usage model would be to pass individual parameters as arrays of parameter values. If you have Get-HPiLOxxx -Server $s -Username $u and -Password $p, then $s, $u and $p could be either a single value each or three arrays of n values that are used to send the same command to n iLOs.

      Hope this helps.

  2. Thanks for this post! My teammate and I were having a lot of trouble with “Set-HPiLOHostPower” until I read this blog post and realized we should be using “Set-HPiLOVirtualPowerButton” instead. Now everything is working like a charm. 🙂

  3. Pingback: Scripted Boot to Home windows PE utilizing HP iLO PowerShell Cmdlets - Kumpulan Trik Dan Tips Terbaru

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s