HPRESTExamples.ps1
<#
(c) Copyright 2015-2017 Hewlett Packard Enterprise Development LP Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. These examples use HPE REST PowerShell cmdlets available at http://www.powershellgallery.com/packages/HPRESTCmdlets/. These scripts provide examples of using HPE RESTful API on HPE iLO for common use cases. These examples use the following base set of cmdlets: Connect-HPREST Disconnect-HPREST Edit-HPRESTData Find-HPREST Format-HPRESTDir Get-HPRESTData Get-HPRESTDataRaw Get-HPRESTDir Get-HPRESTMessage Get-HPRESTHttpData Get-HPRESTIndex Get-HPRESTSchema Get-HPRESTSchemaExtref Get-HPRESTUriFromHref Invoke-HPRESTAction Remove-HPRESTData Set-HPRESTData #> #iLO IP address and credentials to access the iLO $Address = '10.20.30.1' $cred = Get-Credential function Set-BIOSExample1 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $BIOSProperty, [System.String] $Value ) Write-Host 'Example 1: Change a BIOS Setting' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication #Get list of systems $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { #Get BIOS URI from system data $data = Get-HPRESTDataRaw -Href $sys -Session $session $biosURI = $data.Oem.Hp.links.BIOS.href #get BIOS Data $biosData = Get-HPRESTDataRaw -Href $biosURI -Session $session #if property to be modified is not present in the bios data, then print error message and return if(-not(($biosData|Get-Member).Name -contains $BIOSProperty)) { Write-Host "Property $BIOSProperty is not supported on this system" } else { #Get setting href to update bios property. For bios, property can be updated in the settings href only. Other data may or may not have setting href #creating setting object $biosSetting = @{} $biosSetting.Add($BIOSProperty,$Value) #updating setting in system bios settings $ret = Set-HPRESTData -Href $biosURI -Setting $biosSetting -Session $session # processing message obtained by executing Set- cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } } # disconnecting the session after use Disconnect-HPREST -Session $session } #Set-BIOSExample1 -Address $Address -Credential $cred -BIOSProperty 'AdminName' -Value 'test admin' function Reset-ServerExample2 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $Action, [System.String] $PropertyName, [System.String] $PropertyValue ) Write-Host 'Example 2: Reset the server.' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # getting system list $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { # creating setting object to invoke reset action. # Details of invoking reset (or other possible actions) is present in 'AvailableActions' of system data $dataToPost = @{} $dataToPost.Add('Action',$Action) $dataToPost.Add($PropertyName,$PropertyValue) # Sending reset request to system using 'POST' in Invoke-HPRESTAction $ret = Invoke-HPRESTAction -Href $sys -Data $dataToPost -Session $session # processing message obtained by executing Set- cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } # disconnect the session after use Disconnect-HPREST -Session $session } #Reset-ServerExample2 -Address $Address -Credential $cred -Action Reset -PropertyName ResetType -PropertyValue ForceRestart function Set-SecureBootExample3 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $SecureBootProperty, # schema allows changing values for SecureBootEnable, ResetToDefaultKeys, ResetAllKeys [Boolean] $Value #value must be a boolean i.e. $true or $false ) Write-Host 'Example 3: Enable/Disable UEFI secure boot' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { #Get secure boot URI $sysData = Get-HPRESTDataRaw -Href $sys -Session $session $secureBootURI = $sysData.Oem.Hp.links.SecureBoot.href #get secure boot data and display original value $secureBootData = Get-HPRESTDataRaw -Href $secureBootURI -Session $session $secureBootData #if property to be modified is not present in the secure boot data, then print error message and return if(-not(($secureBootData|Get-Member).Name -Contains $SecureBootProperty)) { Write-Host "Property $SecureBootProperty is not supported on this system" } else { # use Set cmdlet at Secure Boot href to update secure boot property. Here only boolean values are allowed for Value parameter # creating hashtable object with property and value $secureBootSetting = @{$SecureBootProperty=$Value} # Execute Set- cmdlet to post enable/disable setting at href for secure boot $ret = Set-HPRESTData -Href $secureBootURI -Setting $SecureBootSetting -Session $session # processing message obtained by executing Set- cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } # get and display updated value of the property $secureBootData = Get-HPRESTDataRaw -Href $secureBootURI -Session $session $secureBootData } } # disconnect the session after use Disconnect-HPREST -Session $session } #Set-SecureBootExample3 -Address $Address -Credential $cred -SecureBootProperty 'SecureBootEnable' -Value $true function Set-BIOSDefaultExample4 { param ( [System.String] $Address, [PSCredential] $Credential, [System.Object] $InitializationSetting ) Write-Host 'Example 4: Set default BIOS settings' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { #Get BIOS URI $sysData = Get-HPRESTDataRaw -Href $sys -Session $session $biosURI = $sysData.Oem.Hp.links.BIOS.href #get BIOS Data and obtain the setting href from it $biosData = Get-HPRESTDataRaw -Href $biosURI -Session $session $biosSettingURI = $biosData.links.settings.href # use BIOS setting URI to obtain setting data $biosSettingData = Get-HPRESTDataRaw -Href $biosSettingURI -Session $session # create bios setting object $newBiosSetting=@{} $newBiosSetting.Add('BaseConfig','Default') # preserve the Type property from the existing BIOS settings to avoid error $newBiosSetting.Add('Type',$biosSettingData.Type) # add other optional initialization settings provided by the user if(-not ($InitializationSetting -eq '' -or $InitializationSetting -eq $null)) { if($InitializationSetting.GetType().ToString() -eq 'System.Management.Automation.PSCustomObject') { foreach($prop in $InitializationSetting.PSObject.Properties) { $newBiosSetting.Add($prop.Name,$prop.Value) } } elseif($InitializationSetting.GetType().ToString() -eq 'System.Collections.Hashtable') { foreach($ky in $InitializationSetting.Keys) { $newBiosSetting.Add($ky,$InitializationSetting[$ky]) } } else { Write-Host 'Invalid input type for InitializationSetting parameter. Use PSObject or PowerShell Hashtable' -ForegroundColor red } } # execure HTTP PUT command using Edit-HPRESTData cmdlet to set BIOS default settings $ret = Edit-HPRESTData -Href $biosSettingURI -Setting $newBiosSetting -Session $session # process returned message from Edit-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } # disconnect the session after use Disconnect-HPREST -Session $session } <# Set-BIOSDefaultExample4 -Address $Address -Credential $cred ## reset makes the BIOS property change effective Reset-ServerExample2 -Address $Address -Credential $cred -Action Reset -PropertyName ResetType -PropertyValue ForceRestart #> function Set-BootOrderExample5 { # Changes the boot order by swapping the first two boot options in the persistant boot order list param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 5: Set boot order (UEFI)' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { #Get BIOS URI $sysData = Get-HPRESTDataRaw -Href $sys -Session $session $biosURI = $sysData.Oem.Hp.links.BIOS.href #get BIOS Data $biosData = Get-HPRESTDataRaw -Href $biosURI -Session $session $bootURI = $biosData.links.Boot.href $bootData = Get-HPRESTDataRaw -Href $bootURI -Session $session $bootData.PersistentBootConfigOrder #if property to be modified is not present in the bios data, then print error message and return if(-not(($bootData|Get-Member).Name.Contains('PersistentBootConfigOrder'))) { Write-Host 'Property PersistentBootConfigOrder is not supported on this system' } else { # changing boot order by interchanging first and second items in the list. Other orders can also be used $bootOrder = $bootData.PersistentBootConfigOrder # |ConvertFrom-Json $temp = $bootOrder[0] $bootorder[0] = $bootOrder[1] $bootOrder[1] = $temp # Getting the href location where the order change has to be 'PATCHed' $bootSettingURI = $bootData.links.settings.href # create object to PATCH $persistentBootConfig = @{'PersistentBootConfigOrder'=$bootOrder} # execute HTTP PATCH operation using Set-HPRESTData cmdlet $ret = Set-HPRESTData -Href $bootSettingURI -Setting $persistentBootConfig -Session $session # process returned message from Set-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } } # disconnect the session after use Disconnect-HPREST -Session $session } <# #---------------------------------------------------------------------------------------------# ## change boot order. Internally the example swaps first and second boot targets. Set-BootOrderExample5 -Address $Address -Credential $cred ##reset maked the boot order effective Reset-ServerExample2 -Address $Address -Credential $cred -Action Reset -PropertyName ResetType -PropertyValue ForceRestart #### wait for server to reboot and POST. (Change sleep time as required) Start-Sleep -Seconds 300 ## change boot order to original by swapping back the first two boot targets Set-BootOrderExample5 -Address $Address -Credential $cred ##reset makes the boot order effective Reset-ServerExample2 -Address $Address -Credential $cred -Action Reset -PropertyName ResetType -PropertyValue ForceRestart #---------------------------------------------------------------------------------------------# #> function Set-TempBootOrderExample6 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $BootTarget ) Write-Host 'Example 6: Set one-time(temporary)boot order' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication #Get system list $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { # get boot data for the system $data = Get-HPRESTDataRaw -Href $sys -Session $session $data.Boot # print available boot targets Write-Host 'Supported boot targets are' $data.boot.BootSourceOverrideSupported if(-not($data.Boot.BootSourceOverrideSupported -Contains $BootTarget)) { # if user provided not supported then print error Write-Host "$BootTarget not supported" } else { # create object to PATCH $tempBoot = @{'BootSourceOverrideTarget'=$BootTarget} $OneTimeBoot = @{'Boot'=$tempBoot} # PATCH the data using Set-HPRESTData cmdlet $ret = Set-HPRESTData -Href $sys -Setting $OneTimeBoot -Session $session #process message returned by Set-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } #get and print updated value $bootData = Get-HPRESTDataRaw -Href $sys -Session $session $bootData.Boot } } # disconnect the session after use Disconnect-HPREST -Session $session } ## NOTE: check the boot targets supported in BootSourceOverrideSupported $data.Boot.BootSourceOverrideSupported. The value is case sensitive. ## E.g. Pxe will work, pxe will not #Set-TempBootOrderExample6 -Address $Address -Credential $cred -BootTarget 'Hdd' function Get-iLOMACAddressExample7 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host "Example 7: Find iLO's MAC addresses" #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $mgr = Get-HPRESTDataRaw -Href 'rest/v1/managers' -Session $session foreach($hrefVal in $mgr.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { #Get manager data $managerData = Get-HPRESTDataRaw -Href $hrefVal -Session $session # retrieve ethernet NIC details $nicURI = $managerData.links.EthernetNICs.href $nicData = Get-HPRESTDataRaw -Href $nicURI -Session $session foreach($nic in $nicData.items) { Write-Host $managerData.Model - $nic.Name - $nic.MacAddress } } # disconnect session after use Disconnect-HPREST -Session $session } #Get-iLOMACAddressExample7 -Address $Address -Credential $cred function Add-iLOUserAccountExample8 { # NOTE: '(400) Bad Request' error will be thrown if the user already exists param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $newiLOLoginName, [System.String] $newiLOUserName, [System.String] $newiLOPassword, [Boolean] $RemoteConsolePriv = $false, [Boolean] $ConfigPriv = $false, [Boolean] $VirtualMediaPriv = $false, [Boolean] $UserConfigPriv = $false, [Boolean] $VirtualPowerResetPriv = $false ) Write-Host 'Example 8: Create an iLO user account.' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Get AccountService data to obtain Accounts href $accData = Get-HPRESTDataRaw -Href 'rest/v1/AccountService' -Session $session $accURI = $accData.links.Accounts.href # create iLO user object # add permissions $priv = @{} $priv.Add('RemoteConsolePriv',$RemoteConsolePriv) $priv.Add('iLOConfigPriv',$ConfigPriv) $priv.Add('VirtualMediaPriv',$VirtualMediaPriv) $priv.Add('UserConfigPriv',$UserConfigPriv) $priv.Add('VirtualPowerAndResetPriv',$VirtualPowerResetPriv) # add login name $hp = @{} $hp.Add('LoginName',$newiLOLoginName) $hp.Add('Privileges',$priv) $oem = @{} $oem.Add('Hp',$hp) # add username and password for access $user = @{} $user.Add('UserName',$newiLOUserName) $user.Add('Password',$newiLOPassword) $user.Add('Oem',$oem) # execute HTTP POST method using Invoke-HPRESTAction to add user data at Accounts href $ret = Invoke-HPRESTAction -Href $accURI -Data $user -Session $session # process messages returned by Invoke-HPRESTAction cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } # Print the list of users. New user will be in this list $accData = Get-HPRESTDataRaw -Href $accData.links.Accounts.href -Session $session $accData.Items # disconnect session after use Disconnect-HPREST -Session $session } #Add-iLOUserAccountExample8 -Address $Address -Credential $cred -newiLOLoginName 'timh' -newiLOUserName 'TimHorton' -newiLOPassword 'timPassword123' -RemoteConsolePriv $true function Set-iLOUserAccountExample9 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $LoginNameToModify, [System.String] $newLoginName = '', [System.String] $newUsername = '', [System.String] $newPassword = '', [System.Object] $RemoteConsolePriv = $null, [System.Object] $ConfigPriv = $null, [System.Object] $VirtualMediaPriv = $null, [System.Object] $UserConfigPriv = $null, [System.Object] $VirtualPowerResetPriv = $null ) Write-Host 'Example 9: Modify an iLO user account.' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # get the href of the iLO user accounts $accData = Get-HPRESTDataRaw -Href 'rest/v1/AccountService' -Session $session $accURI = $accData.links.Accounts.href $members = Get-HPRESTDataRaw -Href $accURI -Session $session $foundFlag = $false $memberURI = '' $user = $null foreach($member in $members.Items) { # check if user is present in the user list if($member.Username -eq $LoginNameToModify) { $foundFlag = $true $memberURI = $member.links.self.href # Create user object with new value(s) $priv = @{} if($RemoteConsolePriv -ne $null){$priv.Add('RemoteConsolePriv',[System.Convert]::ToBoolean($RemoteConsolePriv))} if($ConfigPriv -ne $null){$priv.Add('iLOConfigPriv',[System.Convert]::ToBoolean($ConfigPriv))} if($VirtualMediaPriv -ne $null){$priv.Add('VirtualMediaPriv',[System.Convert]::ToBoolean($VirtualMediaPriv))} if($UserConfigPriv -ne $null){$priv.Add('UserConfigPriv',[System.Convert]::ToBoolean($UserConfigPriv))} if($VirtualPowerResetPriv -ne $null){$priv.Add('VirtualPowerAndResetPriv',[System.Convert]::ToBoolean($VirtualPowerResetPriv))} $hp = @{} if($newLoginName -ne ''){$hp.Add('LoginName',$newLoginName)} if($priv.Count -gt 0){$hp.Add('Privileges',$priv)} $oem = @{} if($hp.Count -gt 0){$oem.Add('Hp',$hp)} $user = @{} if($newUserName -ne ''){$user.Add('UserName',$newUserName)} if($newPassword -ne ''){$user.Add('Password',$newPassword)} if($oem.Count -gt 0){$user.Add('Oem',$oem)} break } } if($foundFlag -eq $true) { # WARNING: If you don't change anything, you will get an HTTP 400 back # PATCH the data using Set-HPRESTData $ret = Set-HPRESTData -Href $memberURI -Setting $user -Session $session if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } # If user name is not found, print message else { Write-Error "$LoginNameToModify not present" } # Disconnect session after use Disconnect-HPREST -Session $session } #Set-iLOUserAccountExample9 -Address $Address -Credential $cred -LoginNameToModify 'TimHorton' -RemoteConsolePriv $false function Remove-iLOUserAccountExample10 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $LoginNameToRemove ) Write-Host 'Example 10: Delete an iLO user account.' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $accData = Get-HPRESTDataRaw -Href 'rest/v1/AccountService' -Session $session $accURI = $accData.links.Accounts.href $members = Get-HPRESTDataRaw -Href $accURI -Session $session $foundFlag = $false $memberURI = '' foreach($member in $members.Items) { # If user to delete is found in user list, note the href of that user in memberURI variable if($member.Username -eq $LoginNameToRemove) { $foundFlag = $true $memberURI = $member.links.self.href break } } if($foundFlag -eq $true) { # If the user was found, executet the HTTP DELETE method on the href of the user to be deleted. $ret = Remove-HPRESTData -Href $memberURI -Session $session # process message(s) from Remove-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } # print list of users. Deleted user will not be present in the list $accData = Get-HPRESTDataRaw -Href $accData.links.Accounts.href -Session $session $accData.Items } else { Write-Error "$LoginNameToRemove not present" } # Disconnect session after use Disconnect-HPREST -Session $session } #Remove-iLOUserAccountExample10 -Address $Address -Credential $cred -LoginNameToRemove TimHorton function Get-ActiveiLONICExample11 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 11: Retrieve active iLO NIC information' # create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # retrieve manager list $managers = Get-HPRESTDataRaw -Href 'rest/v1/Managers' -Session $session foreach($manager in $managers.links.Member.href) { # retrieve manager details and the ethernetNIC href from that $managerData = Get-HPRESTDataRaw -Href $manager -Session $session $nicURI = $managerData.links.EthernetNICs.href # retrieve all NIC information $nics = Get-HPRESTDataRaw -Href $nicURI -Session $session # print NIC details for enabled i.e. active NIC foreach($nic in $nics.items) { if($nic.Status.State -eq 'Enabled') { $nic } } } # Disconnect session after use Disconnect-HPREST -Session $session } #Get-ActiveiLONICExample11 -Address $Address -Credential $cred function Get-SessionExample12 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 12: Retrieve current session information' # connect session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # retrieve all sessions $sessions = Get-HPRESTDataRaw -Href 'rest/v1/Sessions' -Session $session #get the details of current session foreach($ses in $sessions.Items) { if($ses.Oem.Hp.MySession -eq $true) { $ses $ses.oem.hp } } # disconnect session after use Disconnect-HPREST -Session $session } #Get-SessionExample12 -Address $Address -Credential $cred function Set-UIDStateExample13 { param ( [System.String] $Address, [PSCredential] $Credential, [ValidateSet('Lit','Off')] [System.String] $UIDState # Use 'Lit' or 'Off'. Value identified by 'IndicatorLED' field in 'rest/v1/Systems/1'. The value 'Blinking' in mentioned in the schema is not settable by the user. ) Write-Host 'Example 13: Change UID/IndicatorLED status' # connect session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # retrieve list of systems $systems = Get-HPRESTDataRaw -Href 'rest/v1/Systems' -Session $session foreach($sys in $systems.links.Member.href) { # get the href of the system to PATCH the Indicator LED value $sysData = Get-HPRESTDataRaw -Href $sys -Session $session $sysURI = $sysData.links.self.href # create hashtable object to PATCH $UIDSetting = @{'IndicatorLED'=$UIDState} # PATCH the data using Set-HPRESTData cmdlet $ret = Set-HPRESTData -Href $sysURI -Setting $UIDSetting -Session $session # process the message(s) from Set-HPRESTData if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } # Disconnect the session after use Disconnect-HPREST -Session $session } ## NOTE: UID State - Unknown, Lit, Blinking, Off. Unknown and Blinking cannot be set by user #Set-UIDStateExample13 -Address $Address -Credential $cred -UIDState 'Off' function Get-ComputerSystemExample14 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 14: Retrieve information of computer systems' # connect session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # retrieve list of computer systems $systems = Get-HPRESTDataRaw -Href 'rest/v1/Systems' -Session $session # print details of all computer systems foreach($sys in $systems.links.Member.href) { $sysData = Get-HPRESTDataRaw -Href $sys -Session $session $sysData } # Disconnect session after use Disconnect-HPREST -Session $session } #Get-ComputerSystemExample14 -Address $Address -Credential $cred function Set-VirutalMediaExample15 { param ( [System.String] $Address, [PSCredential] $Credential, [System.Object] $IsoUrl = $null, [System.Object] $BootOnNextReset = $null ) # NOTE: if ISO URL is blank and BootOnNextReset are blank/null, the virtual media is unmounted Write-Host 'Example 15 : Mount/Unmount virtual media DVD using URL' # Connect session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $managers = Get-HPRESTDataRaw -Href 'rest/v1/Managers' -Session $session foreach($mgr in $managers.links.Member.href) { $mgrData = Get-HPRESTDataRaw -Href $mgr -Session $session # Check if virtual media is supported if($mgrData.links.PSObject.Properties.name -Contains 'VirtualMedia' -eq $false) { # If virtual media is not present in links under manager details, print error Write-Host 'Virtual media not available in Manager links' } else { $vmhref = $mgrData.links.VirtualMedia.href $vmdata = Get-HPRESTDataRaw -Href $vmhref -Session $session foreach($vm in $vmdata.links.Member.href) { $data = Get-HPRESTDataRaw -Href $vm -Session $session # select the media option which contains DVD if($data.MediaTypes -contains 'DVD') { # Create object to PATCH to update ISO image URI and to set if($IsoUrl -eq $null) { $mountSetting = @{'Image'=$null} } else { $mountSetting = @{'Image'=[System.Convert]::ToString($IsoUrl)} } if($BootOnNextReset -ne $null -and $IsoUrl -ne $null) { # Create object to PATCH $oem = @{'Hp'=@{'BootOnNextServerReset'=[System.Convert]::ToBoolean($BootOnNextReset)}} $mountSetting.Add('Oem',$oem) } # PATCH the data to $vm href by using Set-HPRESTData #Disconnect-HPREST -Session $session $ret = Set-HPRESTData -Href $vm -Setting $mountSetting -Session $session # Process message(s) returned from Set-HPRESTData if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } Get-HPRESTDataRaw -Href $vm -Session $session } } } } # Disconnect session after use Disconnect-HPREST -Session $session } <# # will return '(400) Bad Request' error if the virtual media is already in this state. # IsoUrl = $null will dismount the virtual media. IsoUrl = '' will give 400 Bad Request error. #unmount Set-VirutalMediaExample15 -Address $Address -Credential $cred -IsoUrl $null -BootOnNextReset $false #Mount Set-VirutalMediaExample15 -Address $Address -Credential $cred -IsoUrl 'http://10.20.30.1/iso/Windows/Win2012/en_windows_server_2012_vl_x64_dvd_917758.iso' -BootOnNextReset $true #unmount Set-VirutalMediaExample15 -Address $Address -Credential $cred #> function Set-AssetTagExample16 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $AssetTag ) Write-Host 'Example 16: Update AssetTag value.' # Connect sesion $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Retrieve list of systems $systems = Get-HPRESTDataRaw -Href 'rest/v1/Systems' -Session $session foreach($sys in $systems.links.Member.href) { # Get each system href by first retrieving each system data and then extracting 'Self' href from it $sysData = Get-HPRESTDataRaw -Href $sys -Session $session $sysURI = $sysData.links.self.href # Create hashtable object to PATCH to system href $assetTagSetting = @{'AssetTag'='Test111'} # PATCH data using Set-HPRESTData cmdlet $ret = Set-HPRESTData -Href $sysURI -Setting $assetTagSetting -Session $session # Process message(s) from Set-HPRESTData if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } # Disconnect session after use Disconnect-HPREST -Session $session } #Set-AssetTagExample16 -Address $Address -Credential $cred -AssetTag 'Test2' function Reset-iLOExample17 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 17: Reset the iLO.' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Get list of managers $managers = Get-HPRESTDataRaw -Href 'rest/v1/Managers' -Session $session foreach($mgr in $managers.links.member.href) # rest/v1/managers/1, rest/v1/managers/2 { # for possible operations on the manager check 'AvailableActions' field in manager data # Create hashtable object according to 'AvailableActions' to send to manager href $dataToPost = @{} $dataToPost.Add('Action','Reset') # Send POST request using Invoke-HPRESTAction Invoke-HPRESTAction -Href $mgr -Data $dataToPost -Session $session # resetting iLO will delete all active sessions. } #automatically closes all connections #Disconnect-HPREST -Session $session } #Reset-iLOExample17 -Address $Address -Credential $cred function Get-iLONICExample18 { param ( [System.String] $Address, [PSCredential] $Credential, [ValidateSet('Active','Inactive','All')] [System.String] $NICState = 'Active' ) Write-Host 'Example 18: Retrieve iLO NIC information' # Create Session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Retrieve list of managers $managers = Get-HPRESTDataRaw -Href 'rest/v1/Managers' -Session $session foreach($manager in $managers.links.Member.href) { # Retrieve manager data to extract Ethernet NIC href $managerData = Get-HPRESTDataRaw -Href $manager -Session $session $nicURI = $managerData.links.EthernetNICs.href # Retrieve ethernet NIC details $nics = Get-HPRESTDataRaw -Href $nicURI -Session $session # Display NIC accoring to the NICState parameter foreach($nic in $nics.items) { if($nic.Status.State -eq 'Enabled') { if($NICState -eq 'Active') { $nic break } if($NICState -eq 'All') { $nic } } if($nic.Status.State -eq 'Disabled') { if($NICState -eq 'Inactive') { $nic break } if($NICState -eq 'All') { $nic } } } } # Disconnect the session after use Disconnect-HPREST -Session $session } #Get-iLONICExample18 -Address $Address -Credential $cred -NICState Inactive function Set-ActiveiLONICExample19 { param ( [System.String] $Address, [PSCredential] $Credential, [Boolean] $SharedNIC = $false ) Write-Host 'Example 19: Set the active iLO NIC' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Retrieve list of managers $managers = Get-HPRESTDataRaw -Href 'rest/v1/Managers' -Session $session foreach($manager in $managers.links.Member.href) { $managerData = Get-HPRESTDataRaw -Href $manager -Session $session $nicHref = $managerData.links.EthernetNICs.href $nics = Get-HPRESTDataRaw -Href $nicHref -Session $session $selectedNICHref = '' foreach($nic in $nics.items) { if($SharedNIC -eq $true) { # if a shared NIC setting is required, then check for LOM or Flexible LOM select URI where LOM/FlexLOM is present if($nic.Oem.hp.SupportsFlexibleLOM -eq $null -and $nic.Oem.hp.SupportsLOM -eq $null) { continue; } else { if($nic.Oem.hp.SupportsFlexibleLOM -eq $true) { $selectedNICHref = $nic.links.self.href break } elseif($nic.Oem.hp.SupportsLOM -eq $true) { $selectedNICHref = $nic.links.self.href break } else { Write-Host 'Shared NIC not supported.' } } } else #if sharedNic set to false, select the Href of NIC where LOM/FlexLOM are not present { if($nic.Oem.hp.SupportsFlexibleLOM -eq $null -and $nic.Oem.hp.SupportsLOM -eq $null) { $selectedNICHref = $nic.links.self.href break } } } if($selectedNICHref -ne '') { $req = @{'Oem'=@{'Hp'=@{'NICEnabled' = $true}}} $ret = Set-HPRESTData -Href $selectedNICHref -Setting $req -Session $session # Process message(s) returned from Set-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } } # Disconnect the session after use Disconnect-HPREST -Session $session } #Set-ActiveiLONICExample19 -Address $Address -Credential $cred function Get-IMLExample20 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 20: Retrieve Integrated Management Log (IML)' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Retrieve systems list $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.Member.href) { # Check if logs are available $systemData = Get-HPRESTDataRaw -Href $sys -Session $session if($systemData.links.PSObject.properties.name -notcontains 'Logs') { Write-Host 'Logs not available' } else { # Retrieve the IML href $logURI = $systemData.links.Logs.href $logData = Get-HPRESTDataRaw -Href $logURI -Session $session $imlURI = '' foreach($link in $logData.links.Member.href) { $spl = $link.split('`/') if($spl[$spl.length-1] -match 'IML') { $imlURI = $link break } } # retrieve and display IML log entries $imlData = Get-HPRESTDataRaw -Href $imlURI -Session $session foreach($entryLink in $imlData.links.Entries) { $imlEntries = Get-HPRESTDataRaw -Href $entryLink.href -Session $session $imlEntries.Items } } } # Disconnect the session after use Disconnect-HPREST -Session $session } #Get-IMLExample20 -Address $Address -Credential $cred function Get-iLOEventLogExample21 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 21: Retrieve iLO Event Log' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $managers = Get-HPRESTDataRaw -Href 'rest/v1/managers' -Session $session foreach($mgr in $managers.links.Member.href) { $managerData = Get-HPRESTDataRaw -Href $mgr -Session $session if($managerData.links.PSObject.properties.name -notcontains 'Logs') { Write-Host 'Logs not available' } else { # get the href for iLO event logs $logURI = $managerData.links.Logs.href $logData = Get-HPRESTDataRaw -Href $logURI -Session $session $imlURI = '' foreach($link in $logData.links.Member.href) { $spl = $link.split('`/') if($spl[$spl.length-1] -match 'IEL') { $ielURI = $link break } } # Retrieve and display the log entries $ielData = Get-HPRESTDataRaw -Href $ielURI -Session $session foreach($entryLink in $ielData.links.Entries) { $ielEntries = Get-HPRESTDataRaw -Href $entryLink.href -Session $session $ielEntries.Items } } } # Disconnect the session after use Disconnect-HPREST -Session $session } #Get-iLOEventLogExample21 -Address $Address -Credential $cred function Clear-IMLExample22 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 22: Clear Integrated Management Log' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.Member.href) { # check if logs are available or not $systemData = Get-HPRESTDataRaw -Href $sys -Session $session if($systemData.links.PSObject.properties.name -notcontains 'Logs') { Write-Host 'Logs not available' } else { # extract href href for IML $logURI = $systemData.links.Logs.href $logData = Get-HPRESTDataRaw -Href $logURI -Session $session $imlURI = '' foreach($link in $logData.links.Member.href) { $spl = $link.split('`/') if($spl[$spl.length-1] -match 'IML') { $imlURI = $link break } } # Create hashtable object to invoke action to clear logs # Check 'AvailableActions' for values in this hashtable object $action = @{'Action'='ClearLog'} # POST the object using Invoke-HPRESTAction cmdlet $ret = Invoke-HPRESTAction -Href $imlURI -Data $action -Session $session # Process message(s) returned from Invoke-HPRESTAction cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } } # Disconnect the session after use Disconnect-HPREST -Session $session } <# Clear-IMLExample22 -Address $Address -Credential $cred Get-IMLExample20 -Address $Address -Credential $cred #> function Clear-iLOEventLogExample23 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 23: Clear iLO Event Log' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Retrieve manager list $managers = Get-HPRESTDataRaw -Href 'rest/v1/managers' -Session $session foreach($mgr in $managers.links.Member.href) { $managerData = Get-HPRESTDataRaw -Href $mgr -Session $session # check if logs are available or not if($managerData.links.PSObject.properties.name -notcontains 'Logs') { Write-Host 'Logs not available' } else { # get the href for iLO event logs $logURI = $managerData.links.Logs.href $logData = Get-HPRESTDataRaw -Href $logURI -Session $session $ielURI = '' foreach($link in $logData.links.Member.href) { $spl = $link.split('`/') if($spl[$spl.length-1] -match 'IEL') { $ielURI = $link break } } # Create hashtable object to invoke action to clear logs # Check 'AvailableActions' for values in this hashtable object $action = @{'Action'='ClearLog'} # POST the object using Invoke-HPRESTAction cmdlet $ret = Invoke-HPRESTAction -Href $ielURI -Data $action -Session $session # Process message(s) returned from Invoke-HPRESTAction cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } } # Disconnect the session after use Disconnect-HPREST -Session $session } <# Clear-iLOEventLogExample23 -Address $Address -Credential $cred Get-iLOEventLogExample21 -Address $Address -Credential $cred #> function Set-SNMPExample24 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $Mode, # Agentless or Passthru [System.Object] $AlertsEnabled = $null #use true or false only ) Write-Host 'Example 24: Configure iLO SNMP settings.' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # retrieve list of managers $managers = Get-HPRESTDataRaw -Href 'rest/v1/Managers' -Session $session foreach($mgr in $managers.links.Member.href) { # retrieve settings of NetworkService data $mgrData = Get-HPRESTDataRaw -Href $mgr -Session $session $netSerURI = $mgrData.links.NetworkService.href $netSerData = Get-HPRESTDataRaw -Href $netSerURI -Session $session if($netSerData.links.PSObject.properties.name -notcontains 'SNMPService') { Write-Host 'SNMP services not available in Manager Network Service' } else { # create hashtable object according to the parameters provided by user $snmpSerURI = $netSerData.links.SNMPService.href $snmpSetting = @{} if($mode -ne '' -and $Mode -ne $null) { $snmpSetting.Add('Mode',$Mode) } if($AlertsEnabled -ne $null) { $snmpSetting.Add('AlertsEnabled',[System.Convert]::ToBoolean($AlertsEnabled)) } # PATCh the settings using Set-HPRESTData cmdlet $ret = Set-HPRESTData -Href $snmpSerURI -Setting $snmpSetting -Session $session # Process message(s) returned from Set-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } } # Disconnect the session after use Disconnect-HPREST -Session $session } #Set-SNMPExample24 -Address $Address -Credential $cred -Mode Agentless -AlertsEnabled $true function Get-SchemaExample25 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $Type, [ValidateSet('en','jp','zh')] [System.String] $Language = 'en' ) Write-Host 'Example 25: Retrieve schema' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Retrieve the schema with the Type provided by the user $sch = Get-HPRESTSchema -Type $Type -Language $Language -Session $session $sch.properties # Disconnect the session after use Disconnect-HPREST -Session $session } #Get-SchemaExample25 -Address $Address -Credential $cred -Type ComputerSystem function Get-RegistryExample26 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $RegistryPrefix, [System.String] $Language = 'en' ) Write-Host 'Example 26: Retrieve registry' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # retrieve list of registries $reg = Get-HPRESTDataRaw -href rest/v1/registries -Session $session # select the registry where the prefix is same as value provided by user in 'RegistryPrefix' parameter $reqRegList = $reg.Items | ? {$_.Schema.ToString().IndexOf($RegistryPrefix) -eq 0} # retrieve and display the external reference for the required language foreach($reqReg in $reqRegList) { $reqRegURI = ($reqReg.Location|?{$_.Language -eq $Language}).uri.extref $reqRegData = Get-HPRESTDataRaw -Href $reqRegURI -Session $session $reqRegData } # Disconnect the session after use Disconnect-HPREST -Session $session } #Get-RegistryExample26 -Address $Address -Credential $cred -RegistryPrefix HpBiosAttributeRegistryP89 function Set-TimeZoneExample27 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $TimeZone ) #NOTE: This will work only if iLO is NOT configured to take time settings from DHCP v4 or v6. Otherwise, error 400 - bad request is thrown. Write-Host 'Example 27: Set timezone' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # retrieve manager list $managers = Get-HPRESTDataRaw -href rest/v1/managers -Session $session foreach($mgr in $managers.links.Member.href) { # Retrieve DateTimeService href and timezone name to display to user $mgrData = Get-HPRESTDataRaw -href $mgr -Session $session $dtsURI = $mgrData.Oem.Hp.links.DateTimeService.href $dtsData = Get-HPRESTDataRaw -Href $dtsURI -Session $session $currTimeZone = $dtsData.TimeZone.Name Write-Host "Current timezone $currTimeZone" # from list of all timezone, first check if the user entered value is present in this list. foreach($tz in $dtsData.TimeZoneList) { if($tz.Name -eq $TimeZone) { # User entered timezone value is present. # Create timezone hashtable object to PATCH $setting = @{'TimeZone'=@{'Name'=$tz.name}} # PATCH the new setting using Set-HPRESTData cmdlet $ret = Set-HPRESTData -Href $dtsURI -Setting $setting -Session $session # Process message(s) returned from Set-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } break } } } # Disconnect the session after use Disconnect-HPREST -Session $session } ## Patch using Timezone name is preferred over timezone index. If both are patched, Index field will be ignored ## DHCPv4 should be disabled in active NIC for setting the timezone #Set-TimeZoneExample27 -Address $Address -Credential $cred -TimeZone 'America/Chicago' function Set-iLONTPServerExample28 { param ( [System.String] $Address, [PSCredential] $Credential, [System.Array] $StaticNTPServer ) #NOTE: This will work only if iLO is NOT configured to take time settings from DHCP v4 or v6. Otherwise, error 400 - bad request is thrown. Write-Host 'Example 28: Set NTP server' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # Retrieve manager list $managers = Get-HPRESTDataRaw -href rest/v1/managers -Session $session foreach($mgr in $managers.links.Member.href) { # retrieve date time details and display current values $mgrData = Get-HPRESTDataRaw -Href $mgr -Session $session $dtsURI = $mgrData.Oem.Hp.links.DateTimeService.href $dtsData = Get-HPRESTDataRaw -Href $dtsURI -Session $session Write-Host Current iLO Date and Time setting - $dtsData.ConfigurationSettings Write-Host Current iLO NTP Servers - $dtsData.NTPServers # Create hashtable object with values for NTPServer $setting = @{'StaticNTPServers'=$StaticNTPServer} # PATCH new NTPServer data using Set-HPRESTData $ret = Set-HPRESTData -Href $dtsURI -Setting $setting -Session $session # Process message(s) returned from Set-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } # Disconnect the session after use Disconnect-HPREST -Session $session } ## DHCPv4 should be disabled in active NIC for setting the StaticNTPServer #Set-iLONTPServerExample28 -Address $Address -Credential $cred -StaticNTPServer @('10.20.30.1','10.20.30.2') function Get-PowerMetricExample29 { param ( [System.String] $Address, [PSCredential] $Credential ) #NOTE: This will work only if iLO is NOT configured to take time settings from DHCP v4 or v6 Write-Host 'Example 29: Retrieve PowerMetrics average watts' # Create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # retrieve chassis list $chassis = Get-HPRESTDataRaw -href rest/v1/chassis -Session $session foreach($cha in $chassis.links.member.href) { # get PowerMetrics href, retrieve the data and display $chaData = Get-HPRESTDataRaw -Href $cha -Session $session $pmURI = $chaData.links.PowerMetrics.href $pmData = Get-HPRESTDataRaw -Href $pmURI -Session $session $pm = $pmData.PowerMetrics Write-Host $chaData.Model AverageConsumedWatts = $pm.AverageConsumedWatts watts over a $pm.IntervalInMin minute moving average } # Disconnect the session after use Disconnect-HPREST -Session $session } #Get-PowerMetricExample29 -Address $Address -Credential $cred function Get-BiosDependenciesExample30 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 30: Get BIOS dependencies.' $attRegFromBios = '' $attRegLoc = '' $registries = $null #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication $sysList = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session $registries = Get-HPRESTDataRaw -Href $session.RootData.links.Registries.href -Session $session foreach($sys in $syslist.links.member.href) { # Get the Attribute registry version from BIOS settings $sysData = Get-HPRESTDataRaw -Href $sys -Session $session $biosURI = $sysData.Oem.Hp.links.BIOS.href # get BIOS data $biosData = Get-HPRESTDataRaw -Href $biosURI -Session $session $attRegFromBios = $biosData.AttributeRegistry # get the atttribute registry that matched the BIOS settings foreach($reg in $registries.items) { if($reg.Schema -eq $attRegFromBios) { $attRegLoc = $reg.Location|Where-Object{$_.Language -eq 'en'}|%{$_.uri.extref} # Display the dependencies from the registry entries $attReg = Get-HPRESTDataRaw -Href $attRegLoc -Session $session $attReg.RegistryEntries.Dependencies break } } } # Disconnect the session after use Disconnect-HPREST -Session $session } #Get-BiosDependenciesExample30 -Address $Address -Credential $cred function Set-TPMExample31 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $TPMProperty, # TpmType, TpmState, TPMOperation, TpmVisibility, Tpm2Operation -Tpm2Visibility, Tpm2Ppi, TpmBinding, TpmUefiOpromMeasuring. #These property names may be present or not based on the system configuration. [System.String] $Value <# ## ValueName is the value to be used in REST interface ## ValueDisplayName is seen in RBSU menu options TpmType - ValueName ValueDisplayName --------- ---------------- NoTpm No TPM Tpm12 TPM 1.2 Tpm20 TPM 2.0 Tcm10 TCM 1.0 TpmState ValueName ValueDisplayName --------- ---------------- NotPresent Not Present PresentDisabled Present and Disabled PresentEnabled Present and Enabled TPMOperation ValueName ValueDisplayName --------- ---------------- NoAction No Action Enable Enable Disable Disable Clear Clear TpmVisibility ValueName ValueDisplayName --------- ---------------- Hidden Hidden Visible Visible Tpm2Operation ValueName ValueDisplayName --------- ---------------- NoAction No Action Clear Clear Tpm2Visibility, ValueName ValueDisplayName --------- ---------------- Hidden Hidden Visible Visible Tpm2Ppi ValueName ValueDisplayName --------- ---------------- Enabled Enabled Disabled Disabled TpmBinding ValueName ValueDisplayName --------- ---------------- Enabled Enabled Disabled Disabled TpmUefiOpromMeasuring ValueName ValueDisplayName --------- ---------------- Enabled Enabled Disabled Disabled #> ) Write-Host 'Example 31: Change TPM 2.0 Setting' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication #Get BIOS URI $sys = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($hrefVal in $sys.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { $data = Get-HPRESTDataRaw -Href $hrefVal -Session $session $biosURI = $data.Oem.Hp.links.BIOS.href #get AttributeRegistry value from BIOS Data $biosData = Get-HPRESTDataRaw -Href $biosURI -Session $session $biosData $ar = $biosData.AttributeRegistry # get attribute registries and select the one that matches BIOS data attribute registry $reg = Get-HPRESTDataRaw -Href 'rest/v1/registries' -Session $session #if property to be modified is not present in the bios data, then print error message and return if(-not(($biosData|Get-Member).Name -Contains $TPMProperty)) { Write-Host "Property $TPMProperty is not supported on this system" } else { #Get setting href to update bios property. For bios, property can be updated in the settings href only. other data may not have setting href $biosSettingURI = $biosData.links.settings.href # Create hashtable object with TPM property and value to PATCH $tpmSetting = @{$TPMProperty=$Value} # PATCH TPM setting using Set-HPRESTData $ret = Set-HPRESTData -Href $biosSettingURI -Setting $tpmSetting -Session $session # Process message(s) returned from Set-HPRESTData cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } } # Disconnect the session after use Disconnect-HPREST -Session $session } <# Set-TPMExample31 -Address $Address -Credential $cred -TPMProperty Tpm2Visibility -Value Hidden Reset-ServerExample2 -Address $Address -Credential $cred -Action Reset -PropertyName ResetType -PropertyValue ForceRestart #> function Get-TPMExample32 { param ( [System.String] $Address, [PSCredential] $Credential, [ValidateSet('All', 'TpmType', 'TpmState', 'TPMOperation', 'TpmVisibility', 'Tpm2Operation', 'Tpm2Visibility', 'Tpm2Ppi', 'TpmBinding', 'TpmUefiOpromMeasuring')] [System.String] $TPMProperty = 'All' ) Write-Host 'Example 32: Get TPM Setting' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication #Get BIOS URI $sys = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($hrefVal in $sys.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { $data = Get-HPRESTDataRaw -Href $hrefVal -Session $session $biosURI = $data.Oem.Hp.links.BIOS.href #get AttributeRegistry value from BIOS Data $biosData = Get-HPRESTDataRaw -Href $biosURI -Session $session $ar = $biosData.AttributeRegistry # get attribute registries and select the one that matches BIOS data attribute registry $reg = Get-HPRESTDataRaw -Href 'rest/v1/registries' -Session $session $selectedReg = $null foreach($x in $reg.Items) { if($x.Schema -eq $ar) { $selectedReg = $x } } if($selectedReg -eq $null) { Write-Host 'No valid registry available for BIOS/TPM settings' } else { # Display TMP registry entries $attReg = Get-HPRESTDataRaw -Href ($selectedReg.Location|?{$_.Language -eq 'en'}|%{$_.URI.extref}) -Session $session if($TPMProperty -eq 'All') { $tpmDetails = $attReg.RegistryEntries.Attributes | ?{$_.name -match 'TPM'} $tpmDetails } else { $tpmDetails = $attReg.RegistryEntries.Attributes | ?{$_.name -match $TPMProperty} if(-not(($biosData|Get-Member).Name -Contains $TPMProperty)) { Write-Host "Property $TPMProperty is not supported on this system" } else { $tpmDetails } } } } # Disconnect the session after use Disconnect-HPREST -Session $session } #Get-TPMExample32 -Address $Address -Credential $cred -TPMProperty TpmBinding function Get-ThermalMetricsExample33 { param ( [System.String] $Address, [PSCredential] $Credential ) Write-Host 'Example 33: Get Temperature and Fan details from Thermal Metrics.' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication #retrieve Chassis list $chassisList = Get-HPRESTDataRaw -Href rest/v1/chassis -Session $session foreach($mem in $chassisList.links.Member) { $chasis = Get-HPRESTDataRaw -Href $mem.href -Session $session # get the thermal metrics of the chassis $thermalMetrics = Get-HPRESTDataRaw -Href $chasis.links.ThermalMetrics.href -Session $session # display temperature values Write-Host "Temperature: " $temps = $thermalMetrics.Temperatures $temps # display fan values Write-Host "Fans: " $fans = $thermalMetrics.Fans $fans } Disconnect-HPREST -Session $session } #Get-ThermalMetricsExample33 -Address $Address -Credential $cred function Set-BIOSPowerOnPassword34 { param ( [System.String] $Address, [PSCredential] $Credential, [System.String] $OldPowerOnPassword = '', [System.String] $NewPowerOnPassword ) Write-Host 'Example 34: Change BIOS Password' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication #Get list of systems $systems = Get-HPRESTDataRaw -Href 'rest/v1/systems' -Session $session foreach($sys in $systems.links.member.href) # rest/v1/systems/1, rest/v1/system/2 { #Get BIOS URI from system data $data = Get-HPRESTDataRaw -Href $sys -Session $session $biosURI = $data.Oem.Hp.links.BIOS.href #get BIOS Data $biosData = Get-HPRESTDataRaw -Href $biosURI -Session $session #if property to be modified is not present in the bios data, then print error message and return #Get setting href to update bios property. For bios, property can be updated in the settings href only. Other data may or may not have setting href #creating setting object # provide old and new BIOS password values for the respective fields $biosSetting = @{} $biosSetting.Add("OldPowerOnPassword",$OldPowerOnPassword) $biosSetting.Add("PowerOnPassword",$NewPowerOnPassword) Function Get-StringSHA256Hash { param ( [parameter(Mandatory=$true)] [String] $String ) $StringBuilder = New-Object System.Text.StringBuilder [System.Security.Cryptography.HashAlgorithm]::Create('SHA256').ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String))|%{ [Void]$StringBuilder.Append($_.ToString("X2")) } $StringBuilder.ToString() } if($OldPowerOnPassword -ne "" -and $OldPowerOnPassword -ne $null) { $rsa256Pwd = Get-StringSHA256Hash -String $OldPowerOnPassword $header = @{} $header.Add('X-HPRESTFULAPI-AuthToken',$rsa256Pwd) #updating setting in system bios settings $ret = Set-HPRESTData -Href $biosURI -Setting $biosSetting -Session $session -Header $header } else { #updating setting in system bios settings $ret = Set-HPRESTData -Href $biosURI -Setting $biosSetting -Session $session } # processing message obtained by executing Set- cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } # disconnecting the session after use Disconnect-HPREST -Session $session } <# ##If the old BIOS password is not set: #Set-BIOSPowerOnPassword34 -Address $Address -Credential $cred -OldPowerOnPassword '' -NewPowerOnPassword 'passwd123' ##reset makes the BIOS password setting effective #Reset-ServerExample2 -Address $Address -Credential $cred -Action Reset -PropertyName ResetType -PropertyValue ForceRestart ##If an old BIOS password exists and has to be updated: #Set-BIOSPowerOnPassword34 -Address $Address -Credential $cred -OldPowerOnPassword 'passwd123' -NewPowerOnPassword 'newpasswd' ##reset makes the BIOS password setting effective #Reset-ServerExample2 -Address $Address -Credential $cred -Action Reset -PropertyName ResetType -PropertyValue ForceRestart ##To remove bios password, provide existing password as old password and a blank value for the new password: #Set-BIOSPowerOnPassword34 -Address $Address -Credential $cred -OldPowerOnPassword 'newpasswd' -NewPowerOnPassword '' ##reset makes the BIOS password setting effective #Reset-ServerExample2 -Address $Address -Credential $cred -Action Reset -PropertyName ResetType -PropertyValue ForceRestart #> function Get-AHSLogsExample35 { param ( [System.String] $Address, [System.String] $OutputAHSFile, [PSCredential] $Credential ) Write-Host 'Example 35: Download AHS logs.' #create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication #retrieve Chassis list $managerList = Get-HPRESTDataRaw -Href 'rest/v1/Managers' -Session $session foreach($mem in $managerList.links.Member) { $manager = Get-HPRESTDataRaw -Href $mem.href -Session $session $ahsHref = $manager.Oem.Hp.links.ActiveHealthSystem.href # get the Href for AHS logs $ahsData = Get-HPRESTDataRaw -Href $ahsHref -Session $session $ahsLogHref = $ahsData.links.AHSLocation.extref # get the AHS logs in ByteArray format $ahsLogs = Get-HPRESTDataRaw -Href $ahsLogHref -Session $session -OutputType 'ByteArray' # AHS logs are stored in the specified filename [System.IO.File]::WriteAllBytes($OutputAHSFile, $ahsLogs) } Disconnect-HPREST -Session $session } #Get-AHSLogsExample35 -Address $Address -OutputAHSFile 'c:\ahsLogsOutput.ahs' -Credential $cred function Update-FirmwareExample36 { param( [System.String] [parameter(Mandatory=$true)] $Address = '', [PSCredential] $Credential, [System.String] [parameter(Mandatory=$true)] $FirmwareURI = '', [switch] [parameter(Mandatory=$false)] $TPMOverride ) if($null -eq $FirmwareURI -or $FirmwareURI -eq '') { throw $([string]::Format($(Get-Message('MSG_PARAMETER_MISSING')) ,'FirmwareURI')) } if($null -eq $Address -or $Address -eq '') { throw $([string]::Format($(Get-Message('MSG_PARAMETER_MISSING')) ,'Address')) } Write-Host 'Example 36: Update Firmware' # create session $session = Connect-HPREST -Address $Address -Credential $Credential -DisableCertificateAuthentication # getting managers list $managers = Get-HPRESTDataRaw -Href 'rest/v1/Managers' -Session $session foreach($manager in $managers.links.Member){ # retrieve update service href $managerData = Get-HPRESTDataRaw -Href $manager.href -Session $session $updateURI = $managerData.oem.Hp.links.UpdateService.href #Creating payload $dataToPost = @{} $dataToPost.Add('Action','InstallFromURI') $dataToPost.Add('FirmwareURI',$FirmwareURI) $dataToPost.Add('TPMOverrideFlag', $TPMOverride.IsPresent) # Sending update request to system using 'POST' in Invoke-HPRESTAction $ret = Invoke-HPRESTAction -Href $updateURI -Data $dataToPost -Session $session # processing message obtained by executing Set- cmdlet if($ret.Messages.Count -gt 0) { foreach($msgID in $ret.Messages) { $status = Get-HPRESTError -MessageID $msgID.MessageID -MessageArg $msgID.MessageArgs -Session $session $status } } } Disconnect-HPREST -Session $session } ## Update iLO, ROM, System Programmable Logic Device, or SL/XL chassis firmware using this example. Provide the path on the network share or web server location in the -FirmwareURI parameter #Update-FirmwareExample36 -Address $Address -FirmwareURI 'http://10.20.30.1/firmware/iLO4/ilo4_240_p24_checked.bin' -TPMOverride -Credential $cred # SIG # Begin signature block # MIIjqAYJKoZIhvcNAQcCoIIjmTCCI5UCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDHVwvn4Zg6ljXr # zGvNsREVzCvkCBvZROPBy5uDOxN13aCCHrMwggPuMIIDV6ADAgECAhB+k+v7fMZO # WepLmnfUBvw7MA0GCSqGSIb3DQEBBQUAMIGLMQswCQYDVQQGEwJaQTEVMBMGA1UE # CBMMV2VzdGVybiBDYXBlMRQwEgYDVQQHEwtEdXJiYW52aWxsZTEPMA0GA1UEChMG # VGhhd3RlMR0wGwYDVQQLExRUaGF3dGUgQ2VydGlmaWNhdGlvbjEfMB0GA1UEAxMW # VGhhd3RlIFRpbWVzdGFtcGluZyBDQTAeFw0xMjEy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