The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

Archive for the ‘HP’ Category

Nice to Know – The hidden location for all HP servers drivers

Posted by Mikael Nystrom on November 9, 2016

The latest version of HP support pack was released recently, 2016.10.0 and we downloaded it to deploy it as usual, but Jorgen Brandelius at TrueSec could not resist the need of poking around on the media, and there is was, the hidden folder!!!

image
the magic folder.

What’s in the folder?

In the folder you will find the following structure, it is basically all drivers for Windows Server 2016 (and older supported OS as well) for all supported HP servers, it also includes agents for NANO server running on HP ProLiant.

image

What now?

Download, import and smile while you are deploying the HP server.

image

/mike

Posted in Deployment, Drivers, HP | Tagged: , , , , | 6 Comments »

PowerShell is King – Read HP Bios Sensor data from WMI

Posted by Mikael Nystrom on March 16, 2016

I was bored in my hotel room and I ended up browsing WMI, found one cool/fun thing. I have a EliteBook 8570w and it turns out that HP uses WMI to store data and that makes it possible to read the data using PowerShell of course. Here is how:

Read HP Bios Sensor data from WMI using PowerShell

image

So, here is the actual code for you to copy:


#Read HP Bios Sensor data from WMI using PowerShell
$BIOSSensor = Get-WmiObject -Class HP_BIOSSensor -Namespace root\hp\instrumentedbios
$BIOSSensor | Select-Object Name,CurrentState,CurrentReading,Description

/Mike

Posted in BIOS, HP, PowerShell | Tagged: , , | Leave a Comment »

Working in the Datacenter – Deploying HP Servers and configure BIOS for High Performance using PowerShell

Posted by Mikael Nystrom on March 8, 2016

If you have a HP ProLiant Gen 8 or Gen 9 it is possible to use PowerShell to configure the BIOS. One of the items I really like to configure is the Power Settings, in most cases you would like to have “performance” but the default setting is usually set in “Tree Hugging Mode” (also called power saving). This is especially true if server is going to be used as a Compute server (running Hyper-V).

You can read the previous posts here:

https://deploymentbunny.com/2016/03/07/working-in-the-datacenter-hp-bios-cmdlets-for-windows-powershell-x64/

https://deploymentbunny.com/2016/03/07/working-in-the-datacenter-application-wrapper-for-hp-bios-cmdlets-deploy-it-during-osd/

The Script:

<#
 Install Wrapper 1.0
 Author: Mikael Nystrom
 http://www.deploymentbunny.com 
#>
param($Username,$Password,$mode)
Function Invoke-Exe{
    [CmdletBinding(SupportsShouldProcess=$true)]

    param(
        [parameter(mandatory=$true,position=0)]
        [ValidateNotNullOrEmpty()]
        [string]
        $Executable,

        [parameter(mandatory=$false,position=1)]
        [string]
        $Arguments
    )

    if($Arguments -eq "")
    {
        Write-Verbose "Running $ReturnFromEXE = Start-Process -FilePath $Executable -ArgumentList $Arguments -NoNewWindow -Wait -Passthru"
        $ReturnFromEXE = Start-Process -FilePath $Executable -NoNewWindow -Wait -Passthru
    }else{
        Write-Verbose "Running $ReturnFromEXE = Start-Process -FilePath $Executable -ArgumentList $Arguments -NoNewWindow -Wait -Passthru"
        $ReturnFromEXE = Start-Process -FilePath $Executable -ArgumentList $Arguments -NoNewWindow -Wait -Passthru
    }
    Write-Verbose "Returncode is $($ReturnFromEXE.ExitCode)"
    Return $ReturnFromEXE.ExitCode
}
Function Get-OSVersion([ref]$OSv){
    $OS = Get-WmiObject -class Win32_OperatingSystem
    Switch -Regex ($OS.Version)
    {
    "6.1"
        {If($OS.ProductType -eq 1)
            {$OSv.value = "Windows 7 SP1"}
                Else
            {$OSv.value = "Windows Server 2008 R2"}
        }
    "6.2"
        {If($OS.ProductType -eq 1)
            {$OSv.value = "Windows 8"}
                Else
            {$OSv.value = "Windows Server 2012"}
        }
    "6.3"
        {If($OS.ProductType -eq 1)
            {$OSv.value = "Windows 8.1"}
                Else
            {$OSv.value = "Windows Server 2012 R2"}
        }
    DEFAULT { "Version not listed" }
    } 
}
Function Import-SMSTSENV{
    try
    {
        $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
        Write-Output "$ScriptName - tsenv is $tsenv "
        $MDTIntegration = "YES"
        
        #$tsenv.GetVariables() | % { Write-Output "$ScriptName - $_ = $($tsenv.Value($_))" }
    }
    catch
    {
        Write-Output "$ScriptName - Unable to load Microsoft.SMS.TSEnvironment"
        Write-Output "$ScriptName - Running in standalonemode"
        $MDTIntegration = "NO"
    }
    Finally
    {
    if ($MDTIntegration -eq "YES"){
        $Logpath = $tsenv.Value("LogPath")
        $LogFile = $Logpath + "\" + "$ScriptName.log"

    }
    Else{
        $Logpath = $env:TEMP
        $LogFile = $Logpath + "\" + "$ScriptName.log"
    }
    }
}
Function Start-Logging{
    start-transcript -path $LogFile -Force
}
Function Stop-Logging{
    Stop-Transcript
}

# Set Vars
$SCRIPTDIR = split-path -parent $MyInvocation.MyCommand.Path
$SCRIPTNAME = split-path -leaf $MyInvocation.MyCommand.Path
$SOURCEROOT = "$SCRIPTDIR\Source"
$LANG = (Get-Culture).Name
$OSV = $Null
$ARCHITECTURE = $env:PROCESSOR_ARCHITECTURE

#Try to Import SMSTSEnv
. Import-SMSTSENV

#Start Transcript Logging
. Start-Logging

#Detect current OS Version
. Get-OSVersion -osv ([ref]$osv) 

#Output base info
Write-Output ""
Write-Output "$ScriptName - ScriptDir: $ScriptDir"
Write-Output "$ScriptName - SourceRoot: $SOURCEROOT"
Write-Output "$ScriptName - ScriptName: $ScriptName"
Write-Output "$ScriptName - OS Name: $osv"
Write-Output "$ScriptName - OS Architecture: $ARCHITECTURE"
Write-Output "$ScriptName - Current Culture: $LANG"
Write-Output "$ScriptName - Integration with MDT(LTI/ZTI): $MDTIntegration"
Write-Output "$ScriptName - Log: $LogFile"

$Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList "$env:COMPUTERNAM\$UserName", ($Password | ConvertTo-SecureString -AsPlainText -Force)
$Con = Connect-HPBIOS -IP $env:COMPUTERNAME -Credential $Credentials -ErrorAction Stop

Write-Output "$ScriptName -  Selected Mode: $Mode"

if($mode -eq "FullPower"){
    Set-HPBIOSPowerProfile -Profile Maximum_Performance -Connection $Con
    Set-HPBIOSPowerRegulator -Regulator Static_High_Performance -Connection $Con
    Write-Output "$ScriptName - HP PowerProfile is set to $((Get-HPBIOSPowerProfile -Connection $Con).HPPowerProfile)"
    Write-Output "$ScriptName - HP PowerRegulator is set to $((Get-HPBIOSPowerRegulator -Connection $Con).HPPowerRegulator)"
}

if($mode -eq "TreeHugging"){
    Set-HPBIOSPowerProfile -Profile Minimum_Power -Connection $Con
    Set-HPBIOSPowerRegulator -Regulator Dynamic_Power_Savings -Connection $Con
    Write-Output "$ScriptName - HP PowerProfile is set to $((Get-HPBIOSPowerProfile -Connection $Con).HPPowerProfile)"
    Write-Output "$ScriptName - HP PowerRegulator is set to $((Get-HPBIOSPowerRegulator -Connection $Con).HPPowerRegulator)"
}

. Stop-Logging

Using the script from the command prompt:

Execute the following from an elevated Command Prompt

PowerShell.exe -ExecutionPolicy ByPass -File Configure-HPBIOS.ps1 -Mode FullPower -UserName Administrator –Password P@ssw0rd

Using the script from the PowerShell prompt:

Execute the following from an elevated PowerShell Prompt

.\Configure-HPBIOS.ps1 -Mode FullPower -UserName Administrator –Password P@ssw0rd

Using the script in a Task Sequence when you deploy the server:

You can run the script as PowerShell script in the Task Sequence, or run it as an Application. I prefer to use it as an application since it then can be controlled using rules.

The Config-HPBios application:

image
Here you can see the Quiet install command in the application.

Quiet install command: PowerShell.exe -ExecutionPolicy ByPass -File Configure-HPBIOS.ps1 -Mode %HPPowerMode% -UserName Administrator -Password %AdminPassword%

This command will execute PowerShell and feed the script with Property HPPowerMode (that needs to be FullPower or TreeHugging). This property can be set in CustomSettings.ini or as step in the Task Sequence.

image
Here you can see the Set Task Sequence Variable HPPowerMode set to FullPower.

The actually configuration will be done during the Install step, since it is an application in my case. but it is possible to run the app directly after the Variable has been set.

Check the log file for the result:

image
The log file shows the settings.

/mike

Posted in HP, OS Deployment, OSD, PowerShell | Tagged: , , , , | 1 Comment »

Working in the Datacenter – Application Wrapper for HP BIOS CmdLets – Deploy it during OSD

Posted by Mikael Nystrom on March 7, 2016

In a previous blogpost a shortly described what you can do with the “HP BIOS CmdLets for Windows PowerShell (x64)” and in this post I’ll give you a PowerShell wrapper for LTI/ZTI to deploy it.

Download from installer from

http://h20566.www2.hpe.com/hpsc/swd/public/detail?sp4ts.oid=5440658&swItemId=MTX_1cedc5b3a4ec4bc7a942f6e682&swEnvOid=4168

image

The LTI/ZTI Wrapper:

It is very simple, basically create a folder called “Install – HPBIOSCmdlets”, in the folder, create a folder called “Source” and in that folder you save the MSI file from HP (the download is a EXE, just unzip it and it will be a MSI file inside) and then you save the PowerShell installer in the “Install – HPBIOSCmdlets” folder, like this

image

Here is the:

<#
 Install Wrapper 1.0
 Author: Mikael Nystrom
 http://www.deploymentbunny.com 
#>

Function Invoke-Exe{
    [CmdletBinding(SupportsShouldProcess=$true)]

    param(
        [parameter(mandatory=$true,position=0)]
        [ValidateNotNullOrEmpty()]
        [string]
        $Executable,

        [parameter(mandatory=$false,position=1)]
        [string]
        $Arguments
    )

    if($Arguments -eq "")
    {
        Write-Verbose "Running $ReturnFromEXE = Start-Process -FilePath $Executable -ArgumentList $Arguments -NoNewWindow -Wait -Passthru"
        $ReturnFromEXE = Start-Process -FilePath $Executable -NoNewWindow -Wait -Passthru
    }else{
        Write-Verbose "Running $ReturnFromEXE = Start-Process -FilePath $Executable -ArgumentList $Arguments -NoNewWindow -Wait -Passthru"
        $ReturnFromEXE = Start-Process -FilePath $Executable -ArgumentList $Arguments -NoNewWindow -Wait -Passthru
    }
    Write-Verbose "Returncode is $($ReturnFromEXE.ExitCode)"
    Return $ReturnFromEXE.ExitCode
}
Function Get-OSVersion([ref]$OSv){
    $OS = Get-WmiObject -class Win32_OperatingSystem
    Switch -Regex ($OS.Version)
    {
    "6.1"
        {If($OS.ProductType -eq 1)
            {$OSv.value = "Windows 7 SP1"}
                Else
            {$OSv.value = "Windows Server 2008 R2"}
        }
    "6.2"
        {If($OS.ProductType -eq 1)
            {$OSv.value = "Windows 8"}
                Else
            {$OSv.value = "Windows Server 2012"}
        }
    "6.3"
        {If($OS.ProductType -eq 1)
            {$OSv.value = "Windows 8.1"}
                Else
            {$OSv.value = "Windows Server 2012 R2"}
        }
    DEFAULT { "Version not listed" }
    } 
}
Function Import-SMSTSENV{
    try
    {
        $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
        Write-Output "$ScriptName - tsenv is $tsenv "
        $MDTIntegration = "YES"
        
        #$tsenv.GetVariables() | % { Write-Output "$ScriptName - $_ = $($tsenv.Value($_))" }
    }
    catch
    {
        Write-Output "$ScriptName - Unable to load Microsoft.SMS.TSEnvironment"
        Write-Output "$ScriptName - Running in standalonemode"
        $MDTIntegration = "NO"
    }
    Finally
    {
    if ($MDTIntegration -eq "YES"){
        $Logpath = $tsenv.Value("LogPath")
        $LogFile = $Logpath + "\" + "$ScriptName.txt"

    }
    Else{
        $Logpath = $env:TEMP
        $LogFile = $Logpath + "\" + "$ScriptName.txt"
    }
    }
}
Function Start-Logging{
    start-transcript -path $LogFile -Force
}
Function Stop-Logging{
    Stop-Transcript
}

# Set Vars
$SCRIPTDIR = split-path -parent $MyInvocation.MyCommand.Path
$SCRIPTNAME = split-path -leaf $MyInvocation.MyCommand.Path
$SOURCEROOT = "$SCRIPTDIR\Source"
$LANG = (Get-Culture).Name
$OSV = $Null
$ARCHITECTURE = $env:PROCESSOR_ARCHITECTURE

#Try to Import SMSTSEnv
. Import-SMSTSENV

#Start Transcript Logging
. Start-Logging

#Detect current OS Version
. Get-OSVersion -osv ([ref]$osv) 

#Output base info
Write-Output ""
Write-Output "$ScriptName - ScriptDir: $ScriptDir"
Write-Output "$ScriptName - SourceRoot: $SOURCEROOT"
Write-Output "$ScriptName - ScriptName: $ScriptName"
Write-Output "$ScriptName - OS Name: $osv"
Write-Output "$ScriptName - OS Architecture: $ARCHITECTURE"
Write-Output "$ScriptName - Current Culture: $LANG"
Write-Output "$ScriptName - Integration with MDT(LTI/ZTI): $MDTIntegration"
Write-Output "$ScriptName - Log: $LogFile"

$Executable = "msiexec.exe"
$Arguments = "/i ""$SOURCEROOT\HPBIOSCmdlets-x64.msi"" /qb"

Write-Output "$ScriptName - Executable: $Executable"
Write-Output "$ScriptName - Arguments: $Arguments"

Invoke-Exe -Executable $Executable -Arguments $Arguments -Verbose

. Stop-Logging

Create the Application in the Task Sequence:

(This how it is done in LiteTouch, but it will be the same in ConfigMgr)

Create a new Application, browse to the folder you created and use this as your command line:

PowerShell.exe -ExecutionPolicy Bypass -File Install-HPBIOSCmdlets-x64.ps1

image
It should look something like this.

The logfile

It will end up in C:\Windows\Temp\Deploymentlogs (for LTI) and should look something like this:

image

/mike

Posted in BIOS, HP, OS Deployment, OSD, PowerShell | Tagged: , , , , , | 2 Comments »

Working in the Datacenter – HP BIOS Cmdlets for Windows PowerShell (x64)

Posted by Mikael Nystrom on March 6, 2016

For customers running HP ProLiant servers in the datacenter (many of my customers do) it is now possible to modify the BIOS settings using PowerShell much easier then it used to be. The reason is that HP have released a PowerShell module that makes it possible to modify many of the settings, it actually also works remotely and even in WinPE. So, after it has been installed on a computer and you open up PowerShell and type Get-Help BIOS, you will get this:

image

Download from:

image

The little trick

It seems to be some confusion on how these CmdLets work, but it is very simple. The first command you need to execute is the Connect- CmdLet and that also applies when you run the command on the localhost and a connection does require name and password, this part actually sucks. it would have been so much smarter of HP to accept that commands that are executed locally did not ask for credentials, but that is how it works right now.

The Cool thing

It is possible to connect to multiple servers at the same time and then all commands will be executed in parallel

Connect to the BIOS

$ComputerName = "SRV01"
$UserName = "Administrator"
$Password = "P@ssw0rd"
$Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList "$COMPUTERNAME\$UserName", ($Password | ConvertTo-SecureString -AsPlainText -Force)
$Con = Connect-HPBIOS -IP $env:COMPUTERNAME -Credential $Credentials -ErrorAction Stop

Configure for Tree Hugging Mode

Set-HPBIOSPowerProfile -Profile Minimum_Power -Connection $Con
Set-HPBIOSPowerRegulator -Regulator Dynamic_Power_Savings -Connection $Con
Write-Output "$ScriptName - HP PowerProfile is set to $((Get-HPBIOSPowerProfile -Connection $Con).HPPowerProfile)"
Write-Output "$ScriptName - HP PowerRegulator is set to $((Get-HPBIOSPowerRegulator -Connection $Con).HPPowerRegulator)"

Configure for High Performance

Set-HPBIOSPowerProfile -Profile Maximum_Performance -Connection $Con
Set-HPBIOSPowerRegulator -Regulator Static_High_Performance -Connection $Con
Write-Output "$ScriptName - HP PowerProfile is set to $((Get-HPBIOSPowerProfile -Connection $Con).HPPowerProfile)"
Write-Output "$ScriptName - HP PowerRegulator is set to $((Get-HPBIOSPowerRegulator -Connection $Con).HPPowerRegulator)"

/mike

Posted in BIOS, HP, PowerShell | Tagged: , , | Leave a Comment »

Nice to Know–Deploying Windows Server Technical Preview on HP Proliant Microserver Gen 8

Posted by Mikael Nystrom on October 11, 2014

I use the HP Microserver Gen 8’s at home, since they are quiet and act as a full-grown server with full iLO support, dual network adapters and then some. I can basically do all kinds of testing with new operating systems and system center management platforms without upsetting my family to much and that is very practical.

During the deployment of Windows Server Technical Preview everything worked as expected. After the installation I added the Hyper-V role to start testing to deploy VM’s. I booted up the MDT Boot image, selected the Task Sequence and the install was working great, but hey, the network performance???

According to ImageX it will take 45 minutes to lay down the image! That cannot be correct, there is something wrong here. That kind of slow performance over the network just have to be an issue.. and it is…

You need to update the network driver for the built-in network adapters in HP Proliant Microserver Gen 8.

The built in driver is a Broadcom Nextreme driver and that does not work correctly with Hyper-V

Download the HP Ethernet 1 GB 2-port 332i Adapter driver from HP and install that instead, the 45 minutes is now just 5 minutes…

image

image

Happy Deployment.
/mike

Posted in Drivers, HP, Hyper-V, Windows Server vNext | Tagged: , , , | 2 Comments »

PowerShell is King – HP Scripting Tools for Windows PowerShell v1.1 is released

Posted by Mikael Nystrom on April 21, 2014

The 1.1 version supports PowerShell v3 and v4 and that means you can install it on Windows 8.1 and Windows Server 2012 R2. There is also some added CMDlets plus some minor changes.

Download it from http://www8.hp.com/us/en/products/server-software/product-detail.html?oid=5440657#!tab=features

Release notes is here (read them) http://h20564.www2.hp.com/portal/site/hpsc/public/kb/docDisplay/?docId=c04141539

/mike

Posted in HP, PowerShell | Tagged: | Leave a Comment »

In the LAB–HP Proliant Microserver Gen 8–From G1610T to i5-3470T

Posted by Mikael Nystrom on January 5, 2014

The HP Proliant Microserver Gen 8 is one of the best LAB server for Hyper-V, Private-Cloud, System Center, Windows Server since it has dual network adapters AND a full blown iLO 4, so we can do all kinds of in-bound and out-of-band monitoring. It also support IPMI so it is possible to test and play with bare metal deployment in SCVMM 2012 (R2). But it lacks a bit of performance around the CPU. It comes with the Intel G1610T or Intel G2020T, but since it has a standard 1155 socket and it is of course possible to change the CPU, however this s of course NOT SUPPORTED by HP.

There are a couple of CPUs you can change into (since is a 1155 socket) but basically it comes down to either the “server” version Intel Xeon E3-1230 v2 or the “desktop” version Intel Core i5-3470T. You can look for yourself here to see the difference http://www.cpu-world.com/Compare/490/Intel_Core_i5_i5-3470T_vs_Intel_Xeon_E3-1230_v2.html. My choice was the desktop version, just because I wanted to try that (could not find anyone that had tried it). I think the Intel Xeon E3-1230 v2 is a better choice, but just for fun I wanted to test it. You can compare the Intel I5 3470T with the original G2020T here http://www.cpu-world.com/Compare/466/Intel_Core_i5_i5-3470T_vs_Intel_Pentium_Dual-Core_G2020T.html. The I5 has Hyper-Threading, Intel VT-d and Turbo Boost (plus some more stuff) and and slightly higher CPU speed, but it consumes the same amount of power 35 Watt, so it is a bit more “safe” then the Xeon E3 that consumes 69 Watt (TDP). I do recommend this excellent post to read before you even consider doing anything at all. http://homeservershow.com/forums/index.php?/topic/6596-hp-microserver-gen8-processor-faq/

There are some posts out there that shows how to change the CPU, just remember to get thermal paste before you start, also if you had any form of warranty, which is gone by the wind when you do this…

Here is guide on how to change the CPU http://b3n.org/installed-xeon-e3-1230v2-in-gen8-hp-microserver/

This is how it looks in iLO after replacing the CPU.

HP Proliant Microserver Gen 8 - I5

This is how it looks in Windows Server 2012 R2 after replacing the CPU.

image

/mike

Posted in HP, LAB, LabCenter | Tagged: | 24 Comments »