Dell Bios Upgrade in OSD WinPE x64

Update 3/17 – Update a couple sections to fix Bug in Script with assistance from the Dell BIOS Dev team. Uploaded the TS Export of this section.

Download Here:  3/24 – Removed all of the Bios Files and Update Utility to comply with Dell’s EULA.

Task Sequence Export HERE – You can import this into your system and it will have all the steps., Then copy the steps into your working TS.  No Content is included in this export.  Create your own Package with the “Full Folder Structure Download” and link to that in your TS

image_thumb3

Original Post:

Ok, So for a long time, You couldn’t upgrade Dell’s Bios in WinPE x64 because they didn’t have native x64 bios installer, this has recently changed. – Download HERE
Mike wrote up a nice intro to the new utility HERE

I do all of our bios updates using the “Application Model” after the OS is laid down, so it has the 32bit subsystem, it works fine. But I know many people like to do it during PE.  So I thought I’d play with it this morning and write up a script.

PreReqs for my script: Enabled PowerShell.  Here are the things we’ve enabled: (Win10 1607 Boot Media)
image_thumb21

Benefits of doing it how I’ve setup.

  1. One Script works for all models, you just have to setup your folder structure to match the Computer Model in WMI.
  2. Grabs Bios Password from File, you only have to update one File if you change your Bios Password
  3. Creates TS Variables to avoid Rebooting if already on same bios version.
  4. Creates Log file based on the Bios Update in the %temp%\SMSTSLog Folder (X:\windows\temp\SMSTSLog\BiosFileName.log)
  5. New Bios version release? No Problem, delete the old one, add the new one, update Package, done, no script change required.
  6. It’s Fun

Package Folder Structure.  Make sure the subfolders exactly match the WMI Model Name
Get-WmiObject -Class Win32_computersystem | Select-Object -ExpandProperty Model
image_thumb23

image_thumb31

Once you’ve created your Folder Structure, populate it with the latest Bios files for each model. (Just download and place in the folder, no renaming required)
Also, create a txt file in the package root called Bios.txt and put your Dell Bios password in that file.
image_thumb6

Now, the PowerShell script will query WMI for the Model, look for the bios file inside of the corresponding folder and apply it to the system using the Flash64w.exe utility. (It will pull the password from the bios.txt file in the root of your package)

Updated Script from 3/17 Shown HERE:
image_thumb1

Based on the Exit Code of the Bios Update, it will create a TS Variable you can use to reboot, retry if low battery or continue on with your TS. – More info about Dell Exit Codes here… I noticed it didn’t have them all though: http://en.community.dell.com/techcenter/enterprise-client/w/wiki/3462.dup-bios-updates.  I trigger events based on Exit Code 2 (Successful but requires Reboot) and Exit Code 10 (Battery too Low).  You can easily add additional Exit Codes and create custom variables to have your TS do other thing based on those Exit codes.

Now in your TS:
Create Dell Upgrade Bios Group, and set to only run if a Dell Computer:
select * from Win32_ComputerSystem where Manufacturer like "%Dell%"
image_thumb56
Create Run Command Line Step:
powershell.exe -NoProfile -ExecutionPolicy ByPass -file .\DellBiosUpgradePackage-2.0.ps1
image_thumb57

Create another Group, This will run if the battery was too low to update the Bios.  It will wait 10 minutes and try again.  If the Battery is still too low after that Point, it will continue on without updating Bios. – You can easily put a step here that will popup a message box about how the Bios Didn’t update, etc.
SMSTS_BiosUpdateBatteryCharge = True
image_thumb58
Command Line Step: powershell.exe -NoProfile -ExecutionPolicy ByPass -Command "Start-Sleep -s 600"
image_thumb59
image_thumb41

It will then wait 10 minutes and try again, if successful, it will set variable SMSTS_BiosUpdateRebootRequired = true and continue onto the next group to reboot.  If it fails due to battery again, it will set SMSTS_BiosUpdateBatteryCharge = True and show a Message that it probably has faulty battery.  At this Point, you can click “OK” and let it continue, or turn it off and replace battery.

image_thumb60

Create another Group which will reboot the computer and any other steps needed to get back to where you were before the reboot. (TS Variable = SMSTS_BiosUpdateRebootRequired equals true)
I added a “Format” step, just to ensure there was a place for the Boot Image to download too, this might not be needed in your environment depending on placement of the Bios Upgrade.
image_thumb61

Ok, that should be it.

Note, I was running into some issues with the flashw64.exe utility from Dell, getting this error:
image_thumb19

Once I added another line into the script to launch the software once with minimal arguments, it worked fine. I’ve contacted Dell Support to see if they have any ideas on that.

This is the line I added to fix that error:
start-process "$PSScriptRoot\Flash64W.exe" /"p=$BiosPassword /s"
image_thumb1[1]

However, changing the Argument Line & Update Bios lines fixed the issue, and I haven’t needed that.  I’ve heard from commenters that people are still getting that message, so hopefully this will help. If you do get that message, Open a support issue with Dell, they will help address it.  FYI, I’m also using WinPE 1607, not sure if the Build has anything to do with that error.

Update: 2/27/17 – Response from Dell:
Hello, Gary: I heard back from the BIOS engineering group. They said that they have not tested the utility using Powershell scripts. They do not support Powershell scripts. They only support use of the utility within a command prompt in Windows… It is also supported within WinPE (in a command prompt).

Update 2/28/17 – Call From Dell, they are escalating the issue to the BIOS engineering group and will be looking into the problem to see if they can resolve the issue when using it in PowerShell.

Update 3/17/17 – After working will BIOS Dev team, was able to rework the script to resolve the error I was seeing.  Updated Script in Download and in this Blog Post.

If you run into any problems, let me know and I’ll test that model if I have it.
Tested on so Far:

  1. Laptops
    1. Latitude E5550
    2. Latitude E5470
    3. Latitude E6540
    4. Latitude E6530
    5. Latitude E6430
    6. Latitude E7250
    7. Latitude E7240
    8. Precision 7510
  2. Desktops
    1. OptiPlex 7010

31 thoughts on “Dell Bios Upgrade in OSD WinPE x64

  • February 25, 2017 at 5:01 am
    Permalink

    Many thanks for alerting me to this post and new tool Gary! 🙂

    We've recently swiched over to all Dell clients from HP and so far it's been a 'two-step' process for me build OOB machines. I built a "tools winpe" that includes the cctk that updates the BIOS and updates all the settings fine - but then have to boot into MDT to do the all rest. If I tried to do the same within the task sequence (WinPE section or after OS install) the bios update broke the task sequence due to it auto rebooting to install. Hopefully this new tool will stop me having to do this 🙂

    Best wishes
    Sean

    Reply
  • March 19, 2017 at 11:20 pm
    Permalink

    thx for sharing,
    Is it possible to compare version installed if find older then execute this? other wise it will always run...or maybe i have read wrong...

    thx again for sharing.

    Reply
  • Pingback: Dell BIOS update–WinPE–Model Independent–From Internet – GARYTOWN ConfigMgr Blog

  • March 24, 2017 at 12:10 pm
    Permalink

    Thanks for the Post.
    I get an error when I try to import the Task Sequence
    Failed to load class properties and qualifiers for class BDD_UsePackage in task sequence

    Reply
    • March 24, 2017 at 12:22 pm
      Permalink

      Do you have MDT integrated? This is an MDT Integrated TS export.

      Reply
  • March 31, 2017 at 2:01 pm
    Permalink

    No my Company has not Integrated MDT

    Reply
  • April 19, 2017 at 12:08 pm
    Permalink

    What if there is not any BIOS password set for the machine.
    I tried the same approach in my lab and I received the error 0x80070002. The system cannot find the file specified. I have made sure to create the exact folder structure and distributed the package over DP. The only difference is I don't have any BIOS password so kept the BIOS.txt as blank.
    Any suggestion or should removing the BIOS password parameter from the script is the only solution?

    Reply
  • May 19, 2017 at 9:22 am
    Permalink

    Really great job!

    I have done some quick friday modification to it so it checks if the folder exists before it continues the script and also to compare the versions before it runs, but it requires that you rename the .exe file so it just contains the version number. Now it only updates if the current bios version is less than the "filename".

    Check below:

    # Create Model Variable
    $ComputerModel = Get-WmiObject -Class Win32_computersystem | Select-Object -ExpandProperty Model

    # Test path
    $PathExist = Test-Path .\$ComputerModel

    if ($PathExist -eq "True"){
    # Create Bios Variables
    $BiosCurrentVersion = Get-WmiObject -Class Win32_bios | Select-Object -ExpandProperty SMBIOSBIOSVersion
    $BiosUpgradeVersion = Get-ChildItem $ComputerModel\*.exe -Verbose | Select -ExpandProperty BaseName

    if ($BiosCurrentVersion -lt $BiosUpgradeVersion){
    # Copy Bios Installer to the root of the package - the Flash64W didn't like when I left it in the Computer Model folder, because it has spaces. (Yes, I tried qoutes and stuff)
    Copy-Item $ComputerModel\*.exe -Destination $PSScriptRoot

    # Set Command Arguments for Bios Upgrade
    $cmds = "/b=$BiosUpgradeVersion.exe /f /s /p=$BiosPassword /l=$LogPath\$BiosUpgradeVersion.log"

    # Upgrade Bios
    $Process = start-process $PSScriptRoot\Flash64W.exe -ArgumentList $cmds -PassThru -wait
    }
    }

    Reply
  • May 23, 2017 at 9:29 am
    Permalink

    Another winner. Thanks. I'm running mine with the Run PowerShell Script action instead of Run Command Line because I was getting an unknown error.

    Reply
  • June 1, 2017 at 1:57 pm
    Permalink

    Is there a way to get a Version number out of the Dell Bios files (like A20 or 1.3.3) so I can compare it with the current System Bios version?

    Reply
    • June 5, 2017 at 12:11 pm
      Permalink

      You can probably pull that info from the file name itself, but I haven't had time to look into that. I just run it even if it is updated, as it won't update if it's already current.

      Reply
  • June 5, 2017 at 2:27 pm
    Permalink

    I can't seem to get this to work, I keep getting the memory could not be read error.

    Can you specify what you did to get it to work? I haven't even been able to get flashw.exe to run on its own using cmd.

    Any help would be appreciated. Thanks!

    Reply
    • June 7, 2017 at 9:11 am
      Permalink

      I updated the Post to include info I used to resolve that error the first time. The updated Script I was using resolved it for me, but if you're having the problem, then hopefully adding that one line will solve it for you. Please also then contact Dell Support to see if you can get it resolved without that workaround. If there is a problem with the Dell 64 flash tool, then it's good to get them in the loop.

      Reply
  • June 8, 2017 at 4:27 am
    Permalink

    Hi Gary, thanks for this.

    Question: What if the computer to be updated, needs more than 1 BIOS upgrade? You said "Once you’ve created your Folder Structure, populate it with the latest Bios files for each model." But, in my testing, I saw computer needed 2 different updates (as they dont seem to be "cumulative")

    Thank you.

    Reply
    • June 8, 2017 at 6:39 am
      Permalink

      If you had models that required multiple steps, you could do this a couple ways. You can get the pre-req updates installed manually ahead of time, or you can create additional steps for those models. Basically create an identical package to the one I've listed, then create another step using the Pre-Req Package, which has all of the models that require a pre-req update, and have several variables on the Step, so it only runs if it is Latitude E6510 or E6410, and is A17 or lower, etc. (I have not tested this, as everything I have is already past that point that I need pre-req updates)
      BiosPreReq

      Here is more info: http://www.kraftkennedy.com/deploying-bios-updates-during-sccm-task-sequence-or-advertised-program/

      Reply
  • June 14, 2017 at 2:37 pm
    Permalink

    How many versions can we jump up on our machines at one time? We have machines that were deployed with versions from 1.2.2 to 1.11.3. Can we go straight to the current BIOS or do we still need to increase the version by no more than 3 updates till we get back to current?
    Thank you

    Reply
    • June 14, 2017 at 4:22 pm
      Permalink

      George, you can go straight to the latest version. Dell Bios have checks built in, if it does require a pre-req bios, it will let you know. Don't make extra work for yourself, always go straight to the latest, if you ever find something that didn't work right, open support case with Dell, they want to know, because it should be easy to update.

      Reply
  • August 3, 2017 at 2:31 pm
    Permalink

    What in case if the upgrade process requires a two level. For example - If my current BIOS version is 1.2.4 and I need to upgrade to 1.6.3. I cannot directly upgrade from 1.2.4 to 1.6.3 rather I have to first upgrade from 1.2.4 to 1.4.2 and then from 1.4.2 to 1.6.3 which is a two way upgrade process. So How could I approach this method with the flash64w.exe utility.

    Reply
  • August 8, 2017 at 11:20 am
    Permalink

    PreReqs for my script: Enabled PowerShell. Here are the things we’ve enabled: (Win10 1607 Boot Media)

    Is there anything that requires to enable in the Boot Image properties for Windows 10 1703. I cannot find these options in the properties of 1703 boot media.

    Reply
  • August 24, 2017 at 1:26 pm
    Permalink

    Thanks Gary, this script rocks!!! Nice work! I did run into one issue that I wanted to share for anyone else who may encounter it. If your task sequence deployment is set to 'Access content directly from the distribution point' the script will run but not update the BIOS. The log will show an error 'Unable to locate a BIOS Update Payload'. The problem is with the step to copy the BIOS installer to the root of the package (line 19). Since the content location is on the DP and our network access account does not have write access, the BIOS exe does not copy over. We modified our task sequence deployment to 'Download Content locally when needed by the running task sequence' and the BIOS update is successfully.

    Reply
  • November 9, 2017 at 8:15 pm
    Permalink

    This has worked wonderfully on past Dells, but the newest Latitudes are giving me an issue. The 5289 and 7389, to be exact. After the update runs, it reboots and actually does the upgrade. When it reboots again, it says "no bootable device found". I checked all of the settings in the BIOS, and when I boot again from my USB drive, I can see the hard drive has all of the files there. And it is definitely formatted as UEFI. But no matter what I do, the image on the drive is no longer bootable.
    I have to go ahead and restart the task sequence completely. It works, of course, because the BIOS is already updated, so it skips that step. Hmm.

    Reply
    • November 15, 2017 at 4:30 pm
      Permalink

      JP, having the same issues with my 5289's as well as the 7050 desktops. I just started to look at this again to figure out why.

      Reply
    • December 15, 2017 at 2:07 pm
      Permalink

      Hey JP, found the issue after finding the time to do some testing. From a cohort, he mentioned that it could be the UEFI formatting causing the issue. With this info, I tried the same format and partition task for my UEFI conversion. This task is something quick and dirty nothing special. During this test, it failed and looking at the log, it tells you there isn't enough space on E. I changed the 500mb fat32 partition, to 5GB (no reason why this couldn't be smaller and later when I format the drive before I lay down the OS, it doesn't matter anyway).

      Anyway, this worked for me. However I do my disk prep a little different now per the TS that Gary has provided. I do my disk prep at the beginning of the TS so if it needs a BIOS update, it doesn't format the drive during that group of tasks anymore.

      The issue very well could have been my missteps from the start but I hope this information helps.

      Reply
  • December 14, 2017 at 8:30 am
    Permalink

    I've searched through this post a dozen times now, and I can't find the download link for the PowerShell script.
    Is it available? Would you point me towards a good link, please?

    Reply
      • December 14, 2017 at 2:18 pm
        Permalink

        Live Saver! Thank you!
        I would have sworn I hovered over every word in this post, looking for it.
        Thank You!!

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *