MSEndpointMgr

Lenovo Driver Automation Tool

PLEASE NOTE: Some of the details and features in this post have been superseded. Please review our Modern Driver Management and Modern BIOS Management solutions for up to date information.


DeployEverything Lenovo Driver Download Automation Tool

This is the third in the series of “DeployEverything Driver Download Tools”, this time focusing on Lenovo hardware. If you are running Lenovo client machines and using MDT or SCCM for deployment, this tool automates a significant part of preparing your environment for the deployment of these machines, via the process of downloading, extracting, importing and packaging of drivers.

The script works by reading an XML from Lenovo’s site, reading in the XML and doing some other bits in the background to display the full list of Lenovo driver packages in an easy to read format.

So summarise it does the following;

The tool automates the following processes;

  1. Reads in the XML containing model details
  2. Displays Lenovo Driver Packages based on the OS selection within the GUI
  3. Creates Folders For Each Model
  4. Downloads the selected model driver files
  5. Extracts the driver files
  6. Imports the drivers into SCCM, MDT or Both
  7. Create a Category based on the machine model
  8. Create a Driver Package based on the machine model and OS
  9. Imports the associated drivers into the newly created Driver Package

The job progress log window will automatically scroll at each step of the process and provide feedback.

Job Importing Drivers into SCCM

Job Importing Drivers into MDT

Microsoft Script Library Link – https://gallery.technet.microsoft.com/Lenovo-Driver-Automation-040751e4

How To Run The Script

Launch the script from an administrative PowerShell window using an account with rights to your SCCM site server (if using the SCCM query option)

Enter the name of your SCCM site server and click “Connect to SCCM” if you wish to run an SCCM enabled import job, otherwise select MDT. The list of Lenovo models will auto populate and then select your OS before selecting the model / model family driver packages you require.

Things To Note

  1. Direct internet access is required.
  2. Import driver jobs can take considerable time, this is the same for OEM tools but something to be aware of as the GUI remains static during this process at present. If you are downloading drivers for multiple models you might wish to run this overnight.
  3. Lenovo driver packs for Windows 8.1 and 10 at the present time are for 64 bit versions of the operating system only.
  4. IE ESC will generate pop up’s during the running process. Unfortunately I have not been able to find a way around this due to the way in which the exe links are obtained.

Change Log

Version 1.0 – Initial release.
Version 1.1 – Bug fix for Lenovo web content change
Version 1.2 –  Proxy settings added and bug fix for SCCM downloads. Added percentage and KB output for downloads when SCCM/BOTH is selected.
Version 1.3 – Proxy setting sections updated, additional checks added.
Version 1.4 – Windows 7 bug fix.

Screenshots:


Importing INF Drivers into SCCM

Driver Repository Packages


Driver Packages Created

SCCM :Carbon X1 Generation 4 Diver Pack Contents

MDT: Carbon X1 Generation 4 Diver Pack Contents

SPECIAL THANK YOU

Goes out to Joe Parker (https://twitter.com/joe_lenovo?lang=en) in Lenovo for assisting with the XML creation and ongoing support for the production version using a Lenovo hosted XML.

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.

26 comments

  • Version 1.4 of this script is throwing and SSL/TLS channel error on Windows 2016 when attempting to import drives into my MDT server. I’ve added “[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12” to bypass this, but am still getting the “null-valued expression” errors.

    Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel.
    At E:\Source\Lenovo\LenovoAutoDownload.ps1:1899 char:12
    + $html = Invoke-WebRequest –Uri $URI
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
    eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

    You cannot call a method on a null-valued expression.
    At E:\Source\Lenovo\LenovoAutoDownload.ps1:1917 char:4
    + $tags = ($html.ParsedHtml.getElementsByTagName(“script”) …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At E:\Source\Lenovo\LenovoAutoDownload.ps1:1925 char:5
    + … $farthestEXE = $tags.text.lastIndexOf(“.exe`””, $currentI …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At E:\Source\Lenovo\LenovoAutoDownload.ps1:1931 char:6
    + … $farthestURL = ($tags.text.lastIndexOf(“`”URL`””, $farthe …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    You cannot call a method on a null-valued expression.
    At E:\Source\Lenovo\LenovoAutoDownload.ps1:1933 char:6
    + … $anchors += ($tags.text.Substring($farthestURL + 7, $fart …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

    • Hi Darin,

      Please refer to our tools section and look at the Driver Automation Tool as this post entry is quite old.

      Maurice

  • I tell you what, if we could get something like this to work with Lenovo and IBM server drivers in my world, I would be on a new level.

  • Hi – just run the tool.

    it downloaded the cab file, created all the files and folders in the OS folders, but hasn’t imported or created drivers/driver packages in SCCM?

    • Hi – just run the tool.

      it downloaded the cab file, created all the files and folders in the OS folders, but hasn’t imported or created drivers/driver packages in SCCM?

      I also see the following in the PS window:

      Get-CMDriverPackage : The term ‘Get-CMDriverPackage’ is not recognized as the name of a cmdlet, function, script file,
      or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
      try again.
      At P:\Applications\_UsefulScripts\LenovoAutoDownload\LenovoAutoDownload.ps1:570 char:27
      + $DriverPackage = Get-CMDriverPackage -Name $CMDDriverPackage
      + ~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : ObjectNotFound: (Get-CMDriverPackage:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

      • Hi Simon,

        The standalone Lenovo tool has not been updated in a while now as a combined manufacturer version is available (https://msendpointmgr.com/2017/03/01/driver-automation-tool/). Can you ensure that you are running at least PowerShell 4.0, 5.0+ is preferred though due to issues with the invoke-webrequest command, also ensure that you are running the script on a machine with the ConfigMgr console installed for PS support.

        Maurice

  • Getting ERROR Could not obtain X1Carbon2nd link page.. Skipping. on all driver packs for Windows 7 x64

      • Thank you! This will make my job a whole lot easier. More time for websurfing lol

  • Hi,

    I think there maybe some issue with xml file as I am not seeing all Lenovo models in pick list. For example, the x250,T450, T450s are models in between X240 and X260 and T440 and T460 respectively. I am getting bad link added into MDT.
    MDT: MDT Driver Path = DS001:Out-of-Box DriversWindows 10 x64LenovoX260badLink

    • Hi,

      The list of models is pulled out of the XML provided by Lenovo. See below the full list of machines from the XML listed as Win10 compatible;

      $LenovoModelXML.products.product | Where-Object {$_.os -like “*win10*”} | ft Model,OS

      model os
      —– —
      M600Tiny win10
      M900x win10
      M93p win10
      11e1stGen win10
      11e3rdGen-Braswell win10
      11e3rdGen-Skylake win10
      13 win10
      L450 win10
      L560 win10
      P40Yoga win10
      P50 win10
      T440s win10
      T460s win10
      T560 win10
      X1Carbon3rd win10
      X1Carbon4th win10
      X240s win10
      X260 win10
      Yoga11e1stGen win10
      Yoga11e3rdGen-Braswell win10
      Yoga11e3rdGen-Skylake win10
      Yoga14 win10
      Yoga15 win10
      Yoga460 win10
      P310 win10
      P410 win10
      P500 win10
      P510 win10
      P700 win10
      P900 win10

      I will pass this back to Lenovo.

      Maurice

  • Hi Maurice ,

    I tried the new file but still no success , but now i can see it goes to lenovo website to download the exe and puts a.tmp file in driver cab folder but than exits.

  • Hello Maurice ,

    First of all kudos to you for this tool ..
    I am having few issue though with this .
    Its not downloading anything , it creates the folder structure in our driver repository and SCCM , but nothing is downloaded.
    It creates a folder structure 1)Lenovo–>T460–>badLink-Windows10-x64 and DrverCab , these 2 folders are all empty .
    My machine is directly connected to internet as well , no proxy.
    Would really appreciate , if you can help out on this. 🙂

    • It appears that Lenovo made a change on their website last night and removed one of the values I was searching for to determine the latest exe. I have updated the script to just search for the .exe file on the site and it is working now. Version 1.1 has been uploaded to the MS script site.

  • Hi, the Lenovo version is not working for me. There is no Proxy tab like in the screenshot, and also the Model List is not populating.
    Thanks

    • Hi Patrick. The screenshots were taken of a later build of the script in which I will have proxy server settings. If the model list is not populating make sure you downloaded the latest version off of the MS site (not the beta from earlier) and you have direct Internet access as per the notes.

      • Hey Maurice, I tried with IE configured with a pac file and with a static proxy. It still doesn’t work. I downloaded the script again to make sure that I had the correct version, and I did, from the TechNet lin. I’ll wait for the next version.
        Thanks

      • Patrick the commands within the script require switches if they are to work through a proxy. That is obviously the issue here for you, I’ll have proxy settings up in the next release and I’m adding them in at the same time for the HP one so all three are fairly similar in layout.

Sponsors