Basic PowerShell construct for interacting with HP iLO via the RestAPI
Collection of functions that can be leveraged to establish session connection and interact with HP iLO RestAPI using PowerShell
- New-HpSession
- Creates an ILO session and returns the session details
- Remove-HpSession
- Closes an existing ILO session
- Get-HPSetting
- Gets settings from the HP BIOS using the ILO API
- Test-Call
- Testing function only for interacting with various iLO API URI's
- Set-HPBIOSSettings
- Makes changes to the BIOS that are specified in the JSON payload
- HP Gen9 Server with iLO capability
- Establish an iLO session
$session = New-HpSession -ip $ip -username $username -password $password ```
- Note: If your workstation isn't configured to trust the iLO cert the New-HpSession will prompt you if you wish to temporarily ignore the iLO cert warning
- Interact with the session
Get-HPSetting -Session $session -Config "Boot" ```
- This will retrieve the pending BIOS settings
-
Get-HPSetting -Session $session -Config "Running" ```
- This will retrieve the current BIOS settings
-
Test-Call -IP $ip -Session $session ```
- This will retrieve information for the non-commented URI. This test function contains several URI examples so you can experiment with retrieving info from each one by commenting out and un-commenting different addresses
-
Set-HPBIOSSettings -IP $ip -Json $json -Session $session ```
- This will send the specified JSON payload and make real changes to the server based on options specified in the JSON payload
- Remove the iLO session
Remove-HpSession -Session $Session ```
Authors: Jake Morrison