Recently we had a need to find the versions of HP iLO on all our servers. Finding out through SIM can be challenging so we could log onto each server which was unappealing. I did some searches and could only find a script for scanning based on BASH so I thought I would give it a go in PowerShell. I am sure there are ways to tighten it up but it was fun to do.
I've only run it in PowerShell v2 and it requires the BSonPosh module.
For the web/xml extracting part I found this thread useful.
Things to do would be to use Test-Port to test each IP address for 17988 and limit the addresses of the subnet to that. In our environment we have subnets dedicated iLO so I didn't worry to much about the errors. I have no idea when I will get to that and this was a quick and dirty way to get the information we needed.
# NAME: find-ilo.ps1
# AUTHOR: Steven Peck
# DATE : 2010.01.22
# COMMENT: Find ILO's on subnet
# SOURCE: blog.nachotech.com/?p=63
#REQUIRES: Test-Subnet from BSonPosh module, Tested only in PowerShell v2
# code.msdn.microsoft.com/bsonposh
# ============================================================================
$objResult = @()
$subnet = Ping-Subnet -IP 192.168.1.0 -Netmask 255.255.254.0
foreach ($ip in $subnet) {
[System.Xml.XmlDocument] $xd = new-object System.Xml.XmlDocument
$url = "http://$ip/xmldata?item=ALL"
$rawxml = (new-object System.Net.WebClient).DownloadString($url)
$xd = $rawxml
$ilo = new-object System.Object
$ilo | add-member -MemberType NoteProperty -Name iloIP -value $ip
$ilo | add-member -MemberType NoteProperty -Name iloHW $xd.RIMP.MP.PN
$ilo | add-member -MemberType NoteProperty -Name iloFW $xd.RIMP.MP.FWRI
$ilo | add-member -MemberType NoteProperty -Name ServerSN $xd.RIMP.MP.SN
$ilo | add-member -MemberType NoteProperty -Name ServerModel $xd.RIMP.HSI.SPN
$objResult += $ilo
}
$objResult
Comments
coach outlet. coach handbags
coach outlet. coach handbags and coach purses are sold at best price. http://www.bagworlds.com/
Seven jeans are about sexy,
Seven jeans are about sexy, adventurous, trendsetting apparel and accessories. Shop from our entire line of Seven for mankind.And latest designer True Religion Jeans here, welcome to buy.
Post new comment