MSEndpointMgr

Driver Automation Tool – Version 3.4 Released

Once again thanks to all the members of the ConfigMgr community for their feedback on our Driver Automation Tool. After taking on board your suggestions and issues, version 3.4 is now available.

Whats New

  • Windows 10 Build Support: Build number support for HP systems
  • Windows 10 Build Support: SCCM & MDT paths include Windows build number for HP systems
  • Logging: Completely revised logging process. Logs can now be viewed in real time with CMTrace – “DriverAutomationTool.log”
  • Logging: Verbose logging output to the log file, Job Progress Log used for high level overview
  • Automatic Script Build Check: New script release build and notes will be displayed if a newer version is available
  • Clean Up Actions: All temporary cab, xml, msi and exe files and temporary driver extract folders created in the SCConfigMgr_Tmp folder remove on form exit
  • ConfigMgr Site Detection: The script will attempt to automatically detect the local ConfigMgr management point and site code upon launch
  • Improved Lenovo Model Download Link Detection

Fixes

  • Lenovo Windows 8.1 Driver Download Issues


Microsoft Technet Download Link
– https://gallery.technet.microsoft.com/scriptcenter/Driver-Tool-Automate-9ddcc010

Windows 10 Build Number Driver Support

Recently HP updated their XML driver file to support driver downloads for the various build numbers of Windows 10. This obviously broke the HP driver download links, so apologies for the inconvenience but it is now fixed in this release. You now have two new options in the Operating Systems drop down list, these being Windows 10 1607 and Windows 10 1703. At present these options are available for HP machines, although I have left Microsoft also enabled as the XML will soon be updated to support the new 1703 downloads.

HP EliteDesk 880 G3 Windows 10 1703 Package

To accommodate the Modern Driver Management process there is an updated version of the Invoke-CMDownloadDriverPackage PS script, which can be downloaded from this link – https://github.com/NickolajA/PowerShell/blob/master/ConfigMgr/OS%20Deployment/Invoke-CMDownloadDriverPackage.ps1 . The new OS build number will be listed in the Package Name so you can clearly identify the different build packages you have within the console. Make sure that you have at least ConfigMgr WebService version 1.2.1 installed, can be downloaded from below:

[download id=”6497″]

Improved Logging

This is one of the areas which needed to be overhauled and it has!.

The Job Process Log window in the GUI will still act as a high level overview of the processes running, however a new logging function has been included to write verbose information out to a “DriverAutomationTool.log” file contained within the SCConfigMgr_Temp directory generated by the script. This should provide a more transparent view of what is happening during run time and allow you to troubleshoot any issues or modifications you have made to the script.

Automatic Script Build Check

In order to ensure you are always running the latest version of the download tool, I have included a script version check feature. Should a newer release be available, a new form will pop up notifying you of the newer build number and provide you with both the release notes and a link to the download page.

Clean Up Actions

In addition to the Driver Clean Up Options already built into the script, I have now included a clean up action on the form being closed. The following clean up actions are now taken;

  1. Removal of Driver Cab source files. The extracted drivers will remain in place.
  2. Removal of all files and folders associated with the HP driver extract process.
  3. Removal  of all XML and Cab files downloaded. This will ensure that you always have the latest model list when launching the script.

Site Server & Site Code Detection

The script will attempt to read the details of the local management point and site code from WMI on launch.

Lenovo Driver Link Detection

A newer version of the Lenovo driver script has been provided, thanks to Joe Parker (https://twitter.com/joe_lenovo) in Lenovo for his continued support to the SCCM community on this.

There has also been a correction on logic for Windows 8.1 drivers.

(5460)

Maurice Daly

Maurice has been working in the IT industry for the past 20 years and currently working in the role of Senior Cloud Architect with CloudWay. With a focus on OS deployment through SCCM/MDT, group policies, active directory, virtualisation and office 365, Maurice has been a Windows Server MCSE since 2008 and was awarded Enterprise Mobility MVP in March 2017. Most recently his focus has been on automation of deployment tasks, creating and sharing PowerShell scripts and other content to help others streamline their deployment processes.

42 comments

  • Attempting to use the tool to publish to SCCM. We use a proxy, Admin creds needed to run tool has perms to publish to SCCM, but that account is not allowed to browse web and Proxy requires authentication. Tried entering creds with web browser capabilities, but still not able to find models to import. “Cannot bind parameter ‘ProxyList’. Cannot convert the “System.Net.WebProxy” value of type “System.Net.WebProxy” to “System.Uri”.

    • Hello,
      I am encountering the same error “Cannot bind parameter ‘ProxyList’. Cannot convert the “System.Net.WebProxy” value of type “System.Net.WebProxy” to “System.Uri”, this is through three different corporate connections to the Internet on proxy and without proxy, also on a completely different device connected on a wireless link without proxy and an ADSL connection.

      I am still trying to determine how to resolve the issue.

      Regards.

  • In the Dell Flash 64 Upgrade Download section… of the powershell script

    line 8323 — $Flash64BitZip = $($FlashUtilDir + $(($Flash64BitDownload).href | Split-Path -Leaf))
    line 8323 — if ($Flash64BitZip -eq $false) { —
    — i think 8323 should be “if ((Test-Path -Path $Flash64BitZip) -eq $false) {”

    also the utility extraction logic isn’t right;

    line 8343 —- if ((Test-Path -Path $Flash64BitZip) -eq $true) {
    line 8344 —- if ((Test-Path -Path $Flash64BitZip) -eq $false) {

    it looks like you should be testing whether the exe exists…

    Thanks for the tool though nice in conjuction with Mike Terrill’s Dynamic Drivers blog

  • Gday Maurice, love the tool and have been using it since it was Dell only.

    Couple of q’s:

    1) Preferred feedback method? Since it’s PoSH and there’s no obfuscation I would think that GitHub would be a great place for this and then issues can be raised, forks and commits etc. If you don’t want to go that way i’m just curious what the best way to get in touch with you about this is? I see you replying here and on Technet

    2) Could you please filter out autorun.inf ? Not a big deal but it’s pretty low hanging fruit to clean up the process a bit.

    3) Not sure if anyone else has the issue but approx line 1245 I had to make the following change: New-Item -ItemType Directory -Path “FileSystem::$DriverPackageDest” otherwise new-item failed with Object reference not set to an instance of an object. I checked the variable and it was valid so not sure what was happening there.

  • Thanks for the quick reply. I figured it was something like that. I’ll look into the code to tailor it for our environment (MDT Deploy, CM/1E, but not OSD). Don’t ask, too long to explain.

  • First, thanks for this. I know its a lot of work.

    Second, why does the Dell model list take so long to process the xml file and then prepopulates the selected model list?

    • Hi Gary

      The Dell model list takes a few seconds to populate as it has to do a number of things, including downloading the cab, extracting it as an XML, reading in the XML and then extracting and cleaning up the model listings, then building an array from ConfigMgr WMI based on matching models.

      The pre-populating of the model list is a feature that a lot of people wanted who were used to the Dell only version, as it populates based on Dell client machines known in their ConfigMgr environment.

      Maurice

  • I am proposing adding a section like the following below the header to allow people to customize to their environments more easily. Some of the changes would also allow removing the user information fields for the proxy server.

    #############################
    # Variables #
    #############################

    $UseProxy = $True
    $ProxyServer = “https://proxyserver.mycompany.com”
    $ProxyUser = “”
    $ProxyPassword = “”
    $SCCMServer = “”
    $DefaultPackagePath = ‘\\SERVER\SHARENAME’
    $DefaultRepositoryPath = ‘\\SERVER\SHARENAME’

    Then the lines can be added below
    #Populate File Paths
    $PackagePathTextBox.Text = $DefaultPackagePath
    $RepositoryTextBox.Text = $DefaultRepositoryPath

    #Setup proxy
    if($UseProxy){
    $UseProxyServerCheckbox.Checked = $UseProxy
    $ProxyCred = Get-Credential -Username $ProxyUser -Message “Enter Proxy Credentials”
    $ProxyServerInput.Text = $ProxyServer
    }

    And add the check for a manually inserted SCCM server

    # Attempt SCCM Site Code & MP Detection
    if($SCCMServer -ne “”){
    $SiteServerInput.Text = $SCCMServer
    }
    else
    { #rest of the code that existed

    #The following need modified also
    Replace all instances of
    -ProxyUsage SystemDefault
    With
    -ProxyUsage Override

    We also ran into an issue with the HP driver copy where it copied files from the current execution path into the same location where it was putting the drivers. We are thinking we may need to modify this to go to an empty temporary directory during execution just to prevent the possibility of any extra files making it into the driver source.

    • Hi Eric,

      Thanks for the feedback. I have something coming down the pipeline for this as others have been asking for something similar.

      Maurice

  • Maurice,

    Looks like there is a problem with version 3.5 when attempting to download both Drivers and BIOS from Dell. If the machine has no BIOS updates, the script throws several errors beginning at line 830. To replicate just select 64-Bit Windows 10 files for the Dell Optiplex 3030 AIO

    The log files contain no errors. The errors are shown in the Powershell window.

    Thanks for the work you have put into this.

  • Maurice,
    I just tried restarting the BITS and restarted the server and it will still not download the Dell Precision 7710 drivers, the other 8 I needed to download all work, IT still fails after SCCM: Driver Revision:, SCCM: File Download Failed.

    • Hi Brian,

      If you run the script from a PS window as opposed the exe, then after the download fails exist the script and run Get-Bits-Transfer to see if there are any error messages. I presume the URL is being identified correctly in the script as it does in my environment, but perhaps send me the log file so I can compare it.

      Maurice

  • The proxy check also needed updating to be $ProxyCheck.StatusDescription

    PS C:\Temp\DriverDownloadTool> $ProxyCheck | fl *

    Content : {77, 83, 67, 70…}
    StatusCode : 200
    StatusDescription : OK
    RawContentStream : Microsoft.PowerShell.Commands.WebResponseContentMemoryStream
    RawContentLength : 29962
    RawContent : HTTP/1.1 200 OK

    Before
    if ($ProxyCheck.Description -eq “OK”)

    After
    if ($ProxyCheck.StatusDescription -eq “OK”)

  • Thanks for this! I just tested and the Invoke-WebRequest calls were working with a proxy, but the file downloads were not. I found and fixed the code and the following works. The proxy needs specified and the proxy usage needs set to override.

    Driver
    Start-BitsTransfer -DisplayName “$Model-DriverDownload” -Source $DriverDownloadURL -Destination “$($DriverRepositoryRoot + $Model + ‘\Driver Cab\’ + $DriverCab)” -RetryTimeout 90 -RetryInterval 180 -Asynchronous -ProxyAuthentication NTLM -ProxyCredential $ProxyCred -ProxyUsage SystemDefault -Priority Foreground

    CorrectedDriver
    Start-BitsTransfer -DisplayName “$Model-DriverDownload” -Source $DriverDownloadURL -Destination “$($DriverRepositoryRoot + $Model + ‘\Driver Cab\’ + $DriverCab)” -RetryTimeout 90 -RetryInterval 180 -Asynchronous -ProxyList $ProxyServer -ProxyAuthentication NTLM -ProxyCredential $ProxyCred -ProxyUsage SystemDefault -Priority Foreground

    BIOS
    Start-BitsTransfer ($DellDownloadBase + $BIOSDownload.href) -Destination “$($BIOSUpdateRoot + $BIOSFile)” -RetryTimeout 90 -RetryInterval 180 -ProxyList $ProxyServer -ProxyAuthentication NTLM -ProxyCredential $ProxyCred -ProxyUsage SystemDefault

    CorrectBIOS
    Start-BitsTransfer ($DellDownloadBase + $BIOSDownload.href) -Destination “$($BIOSUpdateRoot + $BIOSFile)” -RetryTimeout 90 -RetryInterval 180 -ProxyList $ProxyServer -ProxyAuthentication NTLM -ProxyCredential $ProxyCred -ProxyUsage Override

    • Hi Eric,

      Good find. I will update the code and publish this later on.

      Maurice

  • I’m getting the error “Issues occurred while reading extracted drivers” with two HP models for Windows 7 x64 which are “HP ProDesk 600 G1 Desktop Mini PC” and “HP EliteDesk 800 G1 Base Model Ultra-slim PC”. Any ideas? I can send you the full log if needed.

    • Hi Mark,

      Send me over the log file and I will have a look at it for you.

      Maurice

      • Hi Mark,

        It would appear that there is an issue with the silent extract switch in the HP softpaq. This happened previously, basically the command uses the following switches “-PDF -F” + “$HPTemp” + ” -S -E” where the $HPTemp folder is a specified value based on the make, model and OS. The package is ignoring any value I put in during tests this morning, resulting in the drivers being extracted and immediately removed.

        I am putting in another check in the script to ensure the temp folder is created before attempting to copy the drivers and I have asked HP to clarify the situation.

        For now please do not use the script with HP downloads. Hopefully I will have word back soon and implement a fix or advise further.

        Maurice

  • Thanks for your work on this great tool. Does this tool pull in the same Lenovo device list as the standalone tool? I ask because none of my 4 machines are listed in the tool:
    X1 Yoga
    Yoga S1 (Gen 1)
    Yoga 12 (Gen 2)
    X131e

    • Hi Brian,

      The tool does indeed pull the same model listings as the standalone version (which I have stopped developing btw). If you take a look at Lenovo’s SCCM support site (https://support.lenovo.com/ie/en/solutions/ht074984) you will see that the X131e is listed up to Windows 8.1 only, if this is selected in the tool the model will display.

      In regards to the other models, I will pass back feedback to Lenovo so they can ensure that the XML is fully populated.

      Maurice

      • I too can’t find the X1 Yoga. To further impact things, Lenovo now has two generations of the X1 Yoga. The first row below is the 1st Gen model codes and the second row is the 2nd Gen model codes.

        — ThinkPad X1 Yoga (Machine Type: 20FQ, 20FR), X1 Carbon (Machine types: 20FB, 20FC)
        — ThinkPad X1 Yoga (Machine types: 20JD, 20JE, 20JF, 20JG)

        Lenovo has a tool called DriverGrabber_2 that will download driver packages but it uses only the same first four characters of the machine type for lookups as listed above.

        I am not sure why these models are not in their .XML

      • Hi Kevin,

        The Yoga X1 is contained within their XML, however it is for Windows 7 32-bit only. I will drop them an email on this as using their SCCM driver download site (https://support.lenovo.com/ie/en/solutions/ht074984) it is clearly available. Lenovo are still developing the XML so think of it was v1.1 at present, hopefully they will improve upon this.

        Maurice

  • Excellent work on the tool.
    For HP systems, does this download ONLY the drivers assembled into their preconfigured full system “Driver Packs”?
    I ask because I find their driver packs to be, more times than not, out of date on individual drivers contained within the packs. Especially for Windows 10.

    • Hi Brandon,

      Indeed the download only option still uses the same logic at the other options, so the HP Softpaq driver cab is downloaded and extracted. Unfortunately as with all manufacturers (some are better than others), there is a delay between drivers being made available for individual components and being wrapped up into SCCM driver packages.

      You could however, download and extract individual driver packages then remove/overwrite those within the driver package if there was an urgent need for the newer driver.

      Maurice

  • Webservice download is throwing an error and Github and technet gallery are showing version 1.2.0 still not 1.2.1??

  • Not that this impacts many people, but we had to add “$ComputerModel = $ComputerModel.Trim()” at ~line 105 of the Invoke-CMDownloadDriverPackage script for one of our HP models. I think it was the 8100 that reported as something like “Compaq Elite 8100 ” with a bunch of extra spaces at the end, preventing the script from matching the model and manufacturer.

      • My TS are failing at this point during the driver detection script:

        # Determine OS Image version for running task sequence from web service
        try {
        $TSPackageID = $TSEnvironment.Value(“_SMSTSPackageID”)
        $OSImageVersion = $WebService.GetCMOSImageVersionForTaskSequence($SecretKey, $TSPackageID)
        Write-CMLogEntry -Value “Retrieved OS Image version from web service: $($OSImageVersion)” -Severity 1
        }
        catch [System.Exception] {
        Write-CMLogEntry -Value “An error occured while calling ConfigMgr WebService to determine OS Image version. Error message: $($_.Exception.Message)” -Severity 3 ; exit 1
        }

        Looking through the web service documentation for 1.2.0, I don’t see GetCMOSImageVersionForTaskSequence. I looked for an updated web service, but can’t seem to find a newer one.

        Thank you guys for all your help!

      • Good catch, sometimes things go a little bit too fast. ConfigMgr WebService 1.2.1 has now been added as a download available in the post.

        Regards,
        Nickolaj

  • Great work guys.
    Would it be possible in a future release to set our own naming convention for the packages in ConfigMgr? For example, instead of “Drivers – – Windows 8.1 x64”, I’d like to use “Drivers – Windows 8.1 x64 – “. That way I can use a task sequence variable created dynamically for the filter for the Invoke-CMDownloadDriverPackage script.

    My task sequence builds multiple OSes, so being able to dynamically create a string to pull only those drivers for the selected OS would be helpful.

    Thanks again for all your work on these tools. Saying that they are “useful” is a big understatement.

    • Hi Mike,

      The order of the naming standard doesn’t really matter, for instance “Drivers – Windows 10 x64 – Latitude XXXX” would also work. We’ve created the script so that it matches a set of variables (manufacturer, model, operating system and for some manufacturer also the Windows 10 build number). So as long as you have those things in the name of your package, the script should be able to detect it. However it doesn’t work if you have multiple OS Images in a single task sequence, that will bring back a list of “OS versions” from the web service that you’d have to manually cater for or extend the current script to suite your needs.

      Regards,
      Nickolaj

  • Great work Maurice on all these new updates to this tool.
    Did you post the correct link for Invoke-CMDownloadDriverPackage.ps1 script as this appears to still be still the old version.

    • Yes as per the previous version, Acer, Dell, HP, Lenovo and Microsoft models are all supported in the one script.

Sponsors