Configure HP Server Bios using Powershell

Hi Everyone

I wanted to share with you a script I developed for configuring HP Server BIOS settings using Powershell

In a recent project I needed to develop a standard way to configure various Bios settings on an HP server. What better way to do it then script it?

A quick search revealed that HP has a nice RESTful API to interact with the BIOS (and iLO) from a remote computer. I jumped on the opportunity to utilize powershell once again and automate the process

Prerequisites

  • Script can run on HP Gen8 / Gen9 type servers
  • Powershell v5.1 – you can download from here
  • HP iLO & BIOS powershell cmdlets – you can download from here
  • The servers must all have iLO enabled and you should have network access to the iLO IP
  • All servers should have the same iLO login credentials
  • A .csv file containing the options you want to configure

Preparations

In my scenario, I needed to keep most of the settings the same, but some were on a per-server basis (for example, on some servers I needed to disable HyperThreading and on some to enable it)

As such, my .csv looks something like this:

Hostname,iLOIP,NUMAGroupSizeOptimization,NodeInterleaving,IntelHyperthreading
Server-01,100.0.0.1,Clustered,Disabled,Disabled

Which means that for Server-01:

  • Numa will be clustered
  • NodeInerleaving will be disabled
  • Intel HT will be disabled

Execution

Download the script from here

From an elevated powershell window, run the following command:

.\SetBiosConfiguration.ps1

This will run the script with default parameters:

  • Servers_CSV “C:Temp\Bios.csv” (The location of the CSV with the servers data)
  • LogPath “C:\Temp\Bios_Configuration.log” (location of the log file the script will generate)
  • BiosStatusPath “C:\Temp\Bios_Status.csv” (location for the summary information after the script has modified all the options)

More Information

If you know your powershell, you can modify many of the configurations that is done. You can use various set cmdlets to set parameters and get cmdlets to retrieve different values

You will also notice that some parameters are set inside and I don’t get the from the CSV. I did the for the simplicity since this is a pretty static environment. However, you can modify it and export more parameters to CSV if you wish

Enjoy

Advertisements

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