The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • about.me

    about.me/mikaelnystrom

  • Archives

  • Meta

Archive for the ‘iLO’ Category

OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 1–Getting the Hardware info)

Posted by Mikael Nystrom on January 6, 2014

This is post refers to this post https://deploymentbunny.com/2013/12/29/os-deployment-oob-install-of-windows-server-2012-r2-using-mdtwds-and-powershell/

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 (https://deploymentbunny.com/2013/12/18/nice-to-know-getting-hardware-infoilo-data-using-native-powershell-and-no-need-for-credentials/)

By reading the XML data in turn it into an object it is rather easy to use the data in PowerShell.

Below you can see the part we use to grab that data.

image

/mike

Posted in Deployment, iLO, MDT, PowerShell, Windows Server 2012 R2 | Tagged: , , | 5 Comments »

OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell

Posted by Mikael Nystrom on December 29, 2013

PowerShell is amazing, it is now possible to do all those things I know would be possible, but did require compiled code or time I don’t have (Still working as an consultant in the real world you know). In my line of work besides automation, flexibility is one other keyword and that is very often used in conjuction with Windows Server deployment. Now, Windows Server is also amazing, it is a multipurpose operating system and multipurpose also means that while client deployment is pretty standard these days, server deployment is not even close to that. In SCCM we have great OS Deployment (even better with MDT integration), but in many cases I’m not allowed to use it. MDT is very flexible and many orgs are using MDT for server deployment and SCCM for clients and they have their reasons, but MDT lacks some of the features that SCCM/MDT does have. We also have an upcoming star and that is SCVMM, while SCVMM has some of the benefits that SCCM have but MDT does not have, well you get the point. But, if you could have bits and pieces from each and every one, and does not require an investment in System Center knowledge, what about having only Active Directory. Windows Deployment Services, DHCP/DNS, MDT and a PowerShell script? Wouldn’t that be nice?

The parts

It is not that hard to setup and configure, but still, there is a lot of moving parts and you need to understand them all, therefore it is dived in the following parts for more details
(note I’ll add the links as soon as I have written them, ok)

  • OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 1–Getting the Hardware info)
  • OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 2–Pre-stage device in AD)
  • OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell  (Part 3–Pre-stage device in MDT)
  • OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 4–Controlling Power remote)
  • OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 5–Controlling Drivers)
  • OS Deployment – Out Of Band install of Windows Server 2012 R2 Using MDT,WDS and PowerShell (Part 6–Apps and Firmware)

The Script

If you know this stuff and just need the script, download it from here: http://sdrv.ms/JCo5bO

Run Import-Module .\ServerDeployment-v1.psm1 –Verbose to import the module

image

run Get-Module to verify

image

To see all the functions you now have, just run Get-Command – Module ServerDeployment-v1

image

to get all the command syntax, just type Get-Command -Module ServerDeployment-v1 –Syntax

image

There is builtin help with command samples, just use Get-Help Command to get the help

image

Note: The script will assume certain things:

There are just a few hardcoded paths, its for the  two modules (yes, there are others way to solve the problem)

Make sure the dependent POSH modules are located here:

  • Import-Module ‘C:\Program Files\Hewlett-Packard\PowerShell\Modules\HPiLOCmdlets’ -ErrorAction Stop
  • Import-Module ‘C:\Program Files\Microsoft Deployment Toolkit\MDTDB.psm1’ -ErrorAction Stop

One last thing, this is not for beginners, you really need to understand the bits and pieces this time.

/mike

Posted in Deployment, iLO, MDT, PowerShell, Windows Deployment Services, Windows Server 2012 R2 | Tagged: , , | 3 Comments »

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

Posted in iLO, PowerShell | Tagged: , , | 8 Comments »