Dell BIOS update–WinPE–Model Independent–From Internet

Update 5/26 - Updated Script to use Dell's Enterprise Cab XML data, instead of the ever changing Support Site.  This now truly does work for all Dell Models that I know of. 🙂  Thanks Mark - POST HERE Mark gives some back story as to how we came up with this idea, and why we wanted to switch from our old method.

Updated Script: (Updated Download as well on 7/11/17 - DOWNLOAD HERE)

The new Package contents:

 

 

 

The Task Sequence:

Just an FYI... you might notice that it's not updating the BIOS to the latest BIOS update for that model.  Example, yesterday several bios updates were released for several models to their WebSite. Those will not install using this method.  The Enterprise CAB data has extra layers of Change Management / Testing, so you can feel even better about applying the BIOS updates automatically. Once those extra layers have completed, then they become available.

 

Until Then, I’ve updated scripts and added a script for the TPM update.

2 scripts now, based on Dell Driver Cab, instead of HTML scraping.

  1. DellTPMDownloadUpdatePE – Downloads and install the TPM 2.0 x64 Update for that model (if available)
  2. DellCabBiosUpdate.ps1

----------------

Original Post:

Ok, so you’re thinking, Gary, you just posted about this, and you’d be right, I did, see.. https://garytown.com/dell-bios-upgrade-in-osd-winpe-x64, but in the past week or so, I’ve come up with an idea, after looking at Maurice Daly’s download utilities, thinking, why can’t I just do something like that, and not have to have any content (beside the script and utility) to update the bios, and have it work on any dell model?  So that’s what I did, with the help of @modaly_IT & @geodesicz (my personal powershell guy), we came up with this solution.

DOWNLOAD HERE

Goal of Script:  Update Dell Bios on Any Model without having to maintain and update packages.

What it does:

  1. Gets Model info from WMI
  2. Downloads latest Bios directly from Dell
    1. No testing with Proxy server done, you can probably add this into the script, just don’t ask me how. (I don’t know, ask Maurice, he has it figured out in his cool GUI version)
    2. Mark (@Geodesicz) was able to make the changes to have this work in PE.
  3. Applies Bios to system during WinPE
  4. Create variables to do extra steps based on exit codes

Pros:

  1. Never manually download a BIOS update and build a BIOS package again
  2. Always install the latest Dell BIOS on the system you’re imaging
  3. Works on all dell models, no tracking down a bios per model
  4. See Number 1

Cons:

  1. Giving up control of the Bios Version you’re installing
    1. This doesn’t bother me personally, I haven’t ever had a BIOS update brick a machine, and if the BIOS is coming directly from Dell, it’s supported by them, and they will assist if anything did happen.
  2. Uses the Internet to pull content, while only 8-12MB per Computer, if you’re imaging large numbers, and you don’t plan ahead, this could be potential issue.
  3. Uses HTML scraping, so if Dell ever changes their website, we’d have to update the script.

 

The Script… while very similar to my last one, it has some key differences.

  1. The Bios Password is now parametrized, no longer requiring the text file to pull password (Thanks Mark)
  2. Has large download section in which it has the logic to get the right Bios file (from Maurice) & the Actual download step, (from Mark).
  3. Validating the Bios downloaded.

This script is quite simple still, feel free to add additional logic to it for error handling.

image

image

 

in the TS:

image

Package Content:
image

As before, it will create logs in the SMSTSLog folder in %temp%.
The only difference now, I added a group that will only run if the Download Fails based on lines 86-90 of the script.

For more details on how to setup the rest, check out the old Post:
https://garytown.com/dell-bios-upgrade-in-osd-winpe-x64

Maurice’s new GUI version: http://www.scconfigmgr.com/2017/03/01/driver-automation-tool/

Maurice’s older version, where I stole the code from: https://gallery.technet.microsoft.com/scriptcenter/SCCM-Dell-Client-Bios-ee577b04

15 thoughts on “Dell BIOS update–WinPE–Model Independent–From Internet

  • March 22, 2017 at 9:24 pm
    Permalink

    This is a great write up, can't wait to try this out in my environment.

    Is there any chance that you have plans to try and implement this independent BIOS download for HP machines as well?

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

      Not at this time, really busy right now, and we only have a couple HP Models that I have to support. But if I ever do, I'll post it here. For now, you'll probably have to use the HP's SSM method to do it if you don't want to make a package.

      Reply
  • March 26, 2017 at 6:38 am
    Permalink

    Great job, thanks for the tips.
    Just a other idea to include, manage Bitlocker encryption before update the BIOS.

    Reply
    • March 27, 2017 at 6:51 am
      Permalink

      The reason it wasn't included as this script was intended to be used during WinPE, before Bitlocker was enabled, so no needed to suspend bitlocker. If you're going to adapt to be used for other things, once Windows is installed and encrypted with bitlocker, you could add something like this:
      #Create Variable of Bitlocker Status
      $BitlockerStatus = Get-BitLockerVolume -MountPoint c: -Verbose | select -ExpandProperty ProtectionStatus -Verbose
      #Check if Bilocker enabled, then suspened.
      If ($BitlockerStatus -eq "On")
      {Suspend-BitLocker -MountPoint "C:" -Verbose
      }
      #Suspend Bitlocker Again for good messure, Win7 Machines don't listen to the PS Command.
      #Fix Mof associated with Bitlocker
      mofcomp.exe c:\windows\system32\wbem\win32_encryptablevolume.mof
      Manage-bde.exe -protectors -disable c:

      Reply
  • April 5, 2017 at 9:53 am
    Permalink

    Awesome script, working well for the most part; I've has success with the Optiplex 7040, 3010 & 790, but the script failed on the 3020. Any idea what the problem is?

    Executing command line: Run Powershell script
    Invoke-WebRequest :
    404 - File or directory not found.
    Server Error

    404 - File or directory not found.
    The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

    At D:\_SMSTaskSequence\Packages\SCM0011E\DellBiosDownloadUpdatePE.ps1:64 char:20
    + ... Download = (Invoke-WebRequest -Uri $ModelURL -UseBasicParsing).Links ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
    eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    Split-Path : Cannot bind argument to parameter 'Path' because it is null.
    At D:\_SMSTaskSequence\Packages\SCM0011E\DellBiosDownloadUpdatePE.ps1:65 char:36
    + $BIOSFile = $BIOSDownload.href | Split-Path -Leaf
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (:) [Split-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SplitPathCo
    mmand

    Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
    At D:\_SMSTaskSequence\Packages\SCM0011E\DellBiosDownloadUpdatePE.ps1:70 char:9
    + $WebClient.DownloadFile($url,$file)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

    You cannot call a method on a null-valued expression.
    At D:\_SMSTaskSequence\Packages\SCM0011E\DellBiosDownloadUpdatePE.ps1:83 char:1
    + $BiosLogFileName = $BiosFile.Replace(".exe",".log")
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    Process completed with exit code 0

    Reply
    • April 7, 2017 at 1:08 pm
      Permalink

      Hey, I haven't tested that model, but you should be able to test by putting a pause in your TS before this would run, then running it line by line to see where it hangs. Probably not reading the Dell Website correctly for that model. Their website isn't always consistent.

      Reply
    • June 27, 2017 at 9:12 am
      Permalink

      OSD does not work.

      Running this on out of date machines. Bios is not updating.

      Reply
      • August 2, 2017 at 9:04 am
        Permalink

        I've run into an issue that sometimes it doesn't download the CAB file from Dell. Is that what you're seeing to? To get around that, I had planned to have it try to download 3 times, if it still didn't download, then use a Pre-Downloaded CAB file. I don't have any environment to test / update these scripts anymore at my new job, so development will have to go to someone else in the community for awhile.

        Reply
  • April 18, 2017 at 5:09 pm
    Permalink

    Gary, great stuff here. Having some issues and maybe just some questions on the TPM update. I have some devices that do fail on the TPM update. They are E7240 devices.

    When I ran though the script the TPM variable comes up blank. I assume that means there is no updates to the TPM? Thought I could still get to 2.0 or is this just a Dell web site being inconsistent. What I think that variable should be is: http://downloads.dell.com/published/pages/latitude-e7240-ultrabook.html

    When I tried to run the update manually I do get an error which leads me to believe I cannot update this laptop.
    The errors are:
    Error: The System TPM Query Failed, Aborting
    Error: Unable to prepare the TPM update payload.

    Reply
  • June 6, 2017 at 11:11 am
    Permalink

    Trying to set this up in our test sequence, and currently have no luck. Seems it is not finding the model in the XML, although if I look through the XML the model is there and there is a download link.

    The error is about null URI, so I went through the PS script and added some Write-Hosts in after each of the Variables $Model, $Target, $TargetLink, $File. And ran the script manually and only $Model had data, the rest were all blank.

    Is there anything that needs to be added to the Boot image or anywhere else for it to read the XML, its reading it somewhat as I also uncommented the link

    # Display List of Available Downloads
    $Names = $Downloads | ForEach {$PSItem.LocalizedProperties.Title}

    And added a Write-Host $Names

    And it does through a large jumble of Models and such into output.

    Thanks

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

      - Info from Mark Godfrey - I found the issue. It has to do with how Dell inputted the model number into the system for the 780. There are numerous trailing spaces after the model name.
      Inline image 1
      Assuming Gary has not modified my original script portion to parse the Dell CAB too much, you should be able to fix this by finding a line that looks like this:

      $Model = (Get-WmiObject win32_computersystem).Model
      and changing it to this:

      $Model = ((Get-WmiObject win32_computersystem).Model).TrimEnd()
      Inline image 2

      BiosUpdateInfoO780

      Reply
    • June 9, 2017 at 8:01 am
      Permalink

      I've updated the script in the Post, it resolves the issue on the 780, and also fixed a bug we found on some other models where it didn't want to download.

      Reply
  • July 10, 2017 at 3:54 pm
    Permalink

    Do you have an export of your task sequence that you can share. With your changes for Old and New Models it would be great to see how you do that in one step. Also from the HowToUse.docx there are undocumented steps for "Notify Download Failed" and those items that follow.

    Reply
    • July 11, 2017 at 10:15 am
      Permalink

      I've updated the download to include the new scripts and a cleaned up "How to". I've removed the notify info, as I as having issues with it in our environment. However, you could create a group based on other exit codes from the BIOS upgrade by having those codes create TS Variables in the script, and have it create a popup or notification if you like.

      Reply
  • July 13, 2017 at 6:22 am
    Permalink

    I've tried your script, but had to fix it to work on some of our PCs.
    The Latitude E5570 did not work - script just failed - found out Dell has several models that use the same bios - so the title in the downloaded XML is "Dell Latitude E5270/E5470/E5570". This means the -match $model fails, because $model is Latitude E5570.

    My simple fix: add this after setting $model:
    if($model -eq "Latitude E5570") {$model = "Latitude E5270"}

    Reply

Leave a Reply

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