Getting minimum Hardware info from HP iLO (No need for credentials)

Thanks to Mikael Nystrom from DeploymentBunny.com cause have added a few addition to his idea and script to work as per my requirement
In HP Servers there is something called iLO, what many people do not know is that you can reach basic information using a normal web browser with out providing credentials, like this:
Just browse to http://IPaddress/xmldata?item=All and you will see this

HP_iLO

The below script reads each and every IP from the input file “Serverlist.txt” (Create a Text File “Serverlist.txt” in the same path you save this script) , the first thing is to try to get the name from DNS, then confirms the connectivity with the ilo, then we load the XML data, we then convert, modify, bend and twist so it looks the way I need it and last we dump it in a CSV file.
<# 
Author : Preenesh Nayanasudhan 
Script : Ping Multiple servers iLO IP provided in Text file Serverlist.txt 
Purpose : iLO Test Experiment - Ping Multiple Servers iLO and publish the result in CSV 
Pre-requisite : Create a Text File Serverlist.txt in the same path you save this script 
#> 
 
# Input file 
$Servers = Get-Content "ServerList.txt" 
$report = @() 
 
ForEach ($server in $Servers) 
{ 
    $HostName = [System.Net.Dns]::GetHostEntry($server).hostname 
    if (test-Connection -ComputerName $server -Count 3 -Quiet ) 
    { 
        $iLOIP = $($server); 
        $PingResult = 'ILO is Alive and Pinging' 
        $XML = New-Object XML  
        $XML.Load("http://$server/xmldata?item=All") 
        $iLOSN = $($XML.RIMP.HSI.SBSN);
        $ServerType = $($XML.RIMP.HSI.SPN); 
        $ProductID = $($XML.RIMP.HSI.PRODUCTID); 
        $ILOType = $($XML.RIMP.MP.PN);  
        $iLOFirmware = $($XML.RIMP.MP.FWRI) 
        $tempreport = New-Object PSObject 
        $tempreport | Add-Member NoteProperty 'ILO IP' $server 
        $tempreport | Add-Member NoteProperty 'Ping Result' $PingResult 
        $tempreport | Add-Member NoteProperty 'ILO HostName' $HostName 
        $tempreport | Add-Member NoteProperty 'ILO Serial NUmber' $iLOSN  
        $tempreport | Add-Member NoteProperty 'Server Type' $ServerType 
        $tempreport | Add-Member NoteProperty 'Product ID' $ProductID 
        $tempreport | Add-Member NoteProperty 'ILO Type' $ILOType 
        $tempreport | Add-Member NoteProperty 'ILO Firmware' $iLOFirmware  
        $report += $tempreport 
    }  
    else  
        {  
        $iLOIP = $($server); 
        $PingResult = 'ILO Seems dead NOT Pinging' 
        $tempreport = New-Object PSObject 
        $tempreport | Add-Member NoteProperty 'ILO IP' $server 
        $tempreport | Add-Member NoteProperty 'Ping Result' $PingResult 
        $tempreport | Add-Member NoteProperty 'ILO HostName' $HostName 
        $report += $tempreport 
    } 
 } 
$report | Export-Csv -NoTypeInformation ('iLO_Timeout_Test.csv')

!! Preenesh

Advertisements
This entry was posted in Powershell and tagged . Bookmark the permalink.

3 Responses to Getting minimum Hardware info from HP iLO (No need for credentials)

  1. I’m glad you did like my script, however, I would like to add the URL to my blogpost in your blog…
    /mike

    Like

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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