The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

Nice to Know – Getting Hardware info(iLO) data using native PowerShell (and no need for credentials)

Posted by Mikael Nystrom on December 18, 2013

During my daily work (building datacenters) I normally need to inventory server information and in many cases there is no infrastructure in place, things like OpsMgr, SCCM, SCVMM and HP’s native tools does not really exists (yet). But for me to be able to redeploy machines, patch machines and get some kind order out of the chaos I need to know.

First step – Getting the idea of it

In HP Servers there is something called iLO, for many people it is the life-line to logon to and do remote console and access, what many people does not know is that you can reach that information using a normal web browser, like this:

Just browse to http://IPaddress/xmldata?item?All and you will se this

image

Next Step – Reading the information using PowerShell and treat it as a PSObject

The basic ide here is to read from each and every IP, the first thing is to try to get the name from DNS, 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 way we like to view it. In this case dumping means Out-Gridview, but it could easily be anything else. You could also add something that “sweeps” the network and try to read it as XML to get a “iLO Scanner”. There is a PowerShell toolkit that gives us a massive amount of CMDlets and they are nice, but, the all require some kind of authentication, this does not require anything at all :-)

image

(in textform)

$iLOIP = "192.168.133.15","192.168.133.16","192.168.133.133","192.168.133.142"

Function GetiLOData {
    foreach ($IP in $ILOIP){
    $XML = New-Object XML
    $HostName = Resolve-DnsName -Name $IP
    $XML.Load("http://$IP/xmldata?item=All")
    New-Object PSObject -Property @{
      iLOName = $($HostName.NameHost);
      iLOIP = $($IP);
      ServerType = $($XML.RIMP.HSI.SPN);
      ProductID = $($XML.RIMP.HSI.PRODUCTID);
      UUID = $($XML.RIMP.HSI.cUUID);
      Nic01 = $($XML.RIMP.HSI.NICS.NIC[0].MACADDR);
      Nic02 = $($XML.RIMP.HSI.NICS.NIC[1].MACADDR);
      ILOType = $($XML.RIMP.MP.PN);
      iLOFirmware = $($XML.RIMP.MP.FWRI)
    }
}
}

GetiLOData | Select iLOName,iLOIP,ServerType,ProductID,Nic01,Nic02,UUID,iLOType,iLOFirmware | Out-GridView

Next Step – Enjoy the view

image

You can download the PowerShell script here http://sdrv.ms/ITvFyO

/mike

2 Responses to “Nice to Know – Getting Hardware info(iLO) data using native PowerShell (and no need for credentials)”

  1. […] Nice to Know – Getting Hardware info(iLO) data using native PowerShell (and no need for creden… […]

  2. […] Out of Band or Bare Metal installation requires information regarding the hardware, that is no surprise. We need to to be able to define settings that can be retried from the hardware. In many/most client deployment scenarios I see people using the MAC Address or, Serial Number but I use the GUID number. When it comes to server they don’t really have one NIC and when it comes to Hyper-V that MAC address will be more or less removed since the machine in most cases is turning the NICs into switches and then virtual NICs will be on top of that, so GUID number is better. All “normal” brands have that, at least with new server hardware. In this case I’m deploying HP Servers and they have iLO which is basically an other name for IPMI. In the case of iLO it is rather easy to access that information, you don’t even need to be authenticated, all the information we need is there (http://deploymentbunny.com/2013/12/18/nice-to-know-getting-hardware-infoilo-data-using-native-powers…) […]

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

 
Follow

Get every new post delivered to your Inbox.

Join 4,036 other followers

%d bloggers like this: