The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

Step-by-Step: Upgrading BIOS during LiteTouch(ZeroTouch) Deployment, for Dell, Hewlett-Packard and Lenovo (v2)

Posted by Mikael Nystrom on December 16, 2013

Long time ago I wrote a post on how to upgrade the BIOS/Firmware during the deployment of a PC in the beginning of a TaskSequence, since then I have been hammered with the question on how to do the same thing but later on, when Windows is running, that has been nagging me, (which obviously paid off for all of you that has been doing that). My friends, here it is, this time in PowerShell, but hey, I don’t do XP anymore.

The basics

The basic Idea is to have a PowerShell script run that will discover what bios version we have and IF we have an update run the update according the that model’s specific way of running a firmware upgrade. It is also possible to just use the PowerShell script as a framework for other similar task of course, or you could use it to kick off something like SSM(HP) to do the job. I did one change, besides using PowerShell and that is to copy down the files to the local drive before running the upgrade, just to be sure that a messy network does not break the upgrade. The script is tested with a couple of HP’s, a Dell and a Lenovo, so there is of course no way I can guarantee it will work with every piece of PC around the globe, but hey, its PowerShell so you can modify it on your own :-). I also created it as an application for MDT LiteTouch, so you need to modify it slightly to run it in SCCM and it also needs the “AliasUserExit.vbs” script since I’m using ModelAlias and MakeAlias. If you don’t like that, just change the lines in he PowerShell code to use Make and Model or anything else that you can read from WMI using PowerShell

The PowerShell script (section One)

This part is just about creating log files, and getting basic data from the TaskSequence/TSEnviroment


The PowerShell script (section Two)

Here you can see the function that gets the SMBIOSBIOSVersion, and for all these vendors it is the same, but that could change in the future, so I decided to use the PowerShell Switch to figure out on how to get it. If you look close you can also see that I’m feeding back data to the TSEnviroment, that is not needed for this to work, but hey, you cannot get enough variables to play with, can you :-)


The PowerShell script (section three)

Here is when we get serious, you need to add every model that should be upgraded as a Switch Value and then update the $ExpectedBIOSVersion so it match what you should have. Then you need to add the BIOS update files in to the folder structure in the the Application and last you need to create/modify the UpgradeBIOS.cmd for each model so it runs whatever it is suppose to run to make magic happen.


The Folder Structure

Here you can see the folder structure, in this case HP Elitebook 8460p also has sub folders, whatever the vendors has a structure I put in the folder and that will then end up on the local drive, where I run the batch file.


The Application in MDT

Just a standard “app” in MDT, I don’t use the “Run PowerShell” script since Applications are easier to modify, move, export, import, and play with. But there should no very little work to get it to work as a script instead, basically the only thing you need to to is to store the script in a folder that the TS can reach, all the folder structure and the file copy is based on where the script is located.


CustomSettings.ini needs to be updated!

To figure out if a reboot is needed or not I added a reboot step and reads the property RebootNedeed, so you need to add that to customsettings.ini


The TaskSequence

As you can see, I did create a folder for this, easy to copy, easy to move, easy to enable/disable. The restart computer step does have a condition, it only executes if RebootNeeded is set to YES, which is set IF you run the BiosUpgrade.CMD batch file, in the PowerShell script I do return 3010 and I also set the RebootNeeded to YES.


The Restart computer Condition



How to?

  • Download the script
  • Unpack
  • Create a new Application in MDT (If you use SCCM or don’t like Apps, modify the script inside the folder first and add it as a script in the TS)
    • CommandLine: powershell.exe -ExecutionPolicy Unrestricted -File ViaMonstraUpgradeBios.ps1
  • Modify the script to fit your computers, versions and download each upgrade into each folder in the folder structure
  • Add it as an application
  • Enjoy

The Download


The “old” Post:

The link to the AliasUserExit Script:

3 Responses to “Step-by-Step: Upgrading BIOS during LiteTouch(ZeroTouch) Deployment, for Dell, Hewlett-Packard and Lenovo (v2)”

  1. Graeme said

    I use the “old” script to upgrade servers while in WinPE (gives me the ability to update before the OS deployment starts in case of any dependencies on new firmware (See the HP Proliant MicroServer issue Johan found). My question is regarding the other firmware components of a server – mainly the SAS Controller and the Lights Out (iDRAC or iLO). Have you determined a good way to do this? I know there are no WMI classes to call to pull data from to see the firmware, but I think I could parse out the Dell command line (omconfig) utility to find the proper code.

    Have you messed around with this at all to find a “good” solution?

    • Yes, I have. I use the HPSUM.exe /express_Install to fix the “rest”. I currently writing a blog on how to install, configure the server with no touch at all, the script will Power on, configurer raid, prestage in WDS, run LTI, install Tools, setup the correct roles, report back and clear state. I’m glad I have a couple of Days to spend on the fun stuff now :-)

  2. […]… […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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

%d bloggers like this: