https://github.com/techthoughts2/ilorestapi
Basic PowerShell examples for interacting with HP iLO via the RestAPI
https://github.com/techthoughts2/ilorestapi
Last synced: 4 months ago
JSON representation
Basic PowerShell examples for interacting with HP iLO via the RestAPI
- Host: GitHub
- URL: https://github.com/techthoughts2/ilorestapi
- Owner: techthoughts2
- Created: 2016-12-15T00:17:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T04:06:00.000Z (about 9 years ago)
- Last Synced: 2025-10-04T02:57:00.163Z (4 months ago)
- Language: PowerShell
- Homepage:
- Size: 5.86 KB
- Stars: 10
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iLORestAPI
Basic PowerShell construct for interacting with HP iLO via the RestAPI
## Synopsis
Collection of functions that can be leveraged to establish session connection and interact with HP iLO RestAPI using PowerShell
## Description
* **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
## Prerequisites
* HP Gen9 Server with iLO capability
## How to run
1. Establish an iLO session
* ```powershell
$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*
2. Interact with the session
* ```powershell
Get-HPSetting -Session $session -Config "Boot" ```
* *This will retrieve the pending BIOS settings*
* ```powershell
Get-HPSetting -Session $session -Config "Running" ```
* *This will retrieve the current BIOS settings*
* ```powershell
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*
* ```powershell
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*
3. Remove the iLO session
* ```powershell
Remove-HpSession -Session $Session ```
### Contributors
Authors: Jake Morrison
http://techthoughts.info
### Notes
http://techthoughts.info/ilo-restful-api-powershell