Getting Lenovo drivers into SCCM – The easy way

The current manual process for obtaining all drivers for a model of Lenovo laptop is;

  • Browse the Lenovo website
  • Download each individual driver
  • Extract the driver
  • Import it into SCCM.

What a pain. Takes hours.

This post is an adaptation of an idea I found here.

The idea is to try and automate some of the process. Instead of using Kenny Buntinx’s recommendation of running the Lenovo thininstaller programme from within a task sequence after downloading all drivers via the Update retriever, I have written a script that extracts the executables.
At the end, the process looks something like this;

  • Use Lenovos Update Retriever to pull down all drivers for your model of laptop.
  • Run my extraction script which parses the downloads from the Update Retriever and then extracts all drivers to a destination path.
  • Import the drivers into SCCM or MDT

This reduces the time to obtain drivers for a model of laptop to less than an hour.

Follow this steps;

  • Download the Lenovo Update Retriever from here and install it
  • Run the software;
    • Set your repository directory (Where you want to place your updates)
    • Important: Set the ‘Status’ drop down list to ‘Active’. The entire process will not work correctly unless you change this!
    • Click ‘continue’ to begin’.
    • Add the model of laptop you require. Note that this requires the 4 digit code model code, not the model type.
  • Edit my script;
    • Change the ‘objStartFolder’ variable to point towards where you downloaded the updates to in the previous step.
    • Change the ‘ModelType’ and ‘PackagePathRoot’ variables to suit your needs. These determine where you want to extract the drivers to.
  • Run the script using cscript from a command line.
  • Import the drivers into SCCM.

The script works by reading the XML file provided with each update. It searches for the ‘ExtractCommand’ element and then runs it for each update. The script is rather crude at the moment and needs tidying up. Please feel free to fix it up and improve it…It needs some TLC!

The code (WordPress seems to strip out the formatting..);

' ExtractDrivers

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")

objStartFolder = "D:\Lenovo_Repository"

ModelType = "T410"
PackagePathRoot = "C:\" & ModelType & "\"

Dim filePath

ShowSubfolders objFSO.GetFolder(objStartFolder)

Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
filePath=Subfolder.Path
WScript.Echo "---------------------------------------------------------"
Set objFolder = objFSO.GetFolder(Subfolder.Path)
Set colFiles = objFolder.Files
For Each objFile in colFiles
If LCase(Right(Cstr(objFile.Name), 3)) = "xml" Then
getAttributes2(ObjFile.Path)
End If
Next
Wscript.Echo
ShowSubFolders Subfolder
Next
End Sub

Sub getAttributes2(fileToSearch)
Dim xmlDoc, objNodeList

Set xmlDoc = CreateObject("Msxml2.DOMDocument")
WScript.Echo "Processing: " & fileToSearch
xmlDoc.load(fileToSearch)
Set objNodeList = xmlDoc.getElementsByTagName("Package")

name = objNodeList.item(0).getAttribute("name")

Set objNodeList = xmlDoc.getElementsByTagName("Desc")
If objNodeList.length > 0 Then
desc2=objNodeList.item(0).text

Else
WScript.echo chr(34) & "ExtractCommand" & chr(34) & " field not found."
End If

WScript.Echo "Description: " & desc2
Set objNodeList = xmlDoc.getElementsByTagName("ExtractCommand")
If objNodeList.length > 0 then
For each x in objNodeList
Extract=x.text
fullExtract = filePath & "\" & Extract

desc3=Replace(desc2,"/","_")
replacedExtract=Replace(fullExtract,"%PACKAGEPATH%","""" & PackagePathRoot & desc3 & """")
splitText = Split(replacedExtract," ")
If objFSO.FileExists(splitText(0)) Then
WScript.Echo vbCRLF & "Located Executable: " & splitText(0)
WScript.Echo "Running Extraction: " & replacedExtract
WshShell.Run replacedExtract,0,True

Else
WScript.Echo "Found NOT file: " & splitText(0)
End If
Next
Else
WScript.echo chr(34) & "ExtractCommand" & chr(34) & " field not found."
End If

End Sub

Let me know your thoughts, I would be interested in tarting this process up a bit.

Richard

48 thoughts on “Getting Lenovo drivers into SCCM – The easy way

  1. Thank you so much for putting this together! What a life saver. We’re strictly a Dell shop, but our hands were tied when a client of ours insisted upon buying a bunch of Lenovo Thinkpad X220’s. After having downloaded all the drivers via the Update Retriever I soon realized that the format they downloaded in wasn’t ideal for our MDT2010 setup. This script will make deployment a breeze! I really can’t thank you enough 🙂
    ~Drew

  2. This script looks awesome, and it’s just what I was looking for! We’re in the process of moving our company to an all-Lenovo operation, and (lucky me!) have been put in charge of sorting out all the SCCM imaging for that. This will be immensely helpful! Thanks!

  3. We’ve now enhanced Update Retriever with an Export function…it will race through the repository, and provide you with drivers already extracted, ready to be imported into MDT. You just select Manage Repository, Export Updates. No script required….

    The newer version of Update Retriever, Thininstaller, and some documentation can be found on this URL:
    http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?LegacyDocID=TVAN-ADMIN

    1. Retriever simply sucks, it is a bib mix and match of all drivers. Look at HP and Dell and learn one or two things regarding driver management.

      1. I don’t think you’ve tried it then…
        First, you can select only the machines you are concerned with, by OS and language.
        Second, the program can create either an extracted driver folder for a given machine/language, OR you can use its database of drivers with our Thin Installer program, which will race through all the drivers for a given machine, but only apply the appropriate ones. It does most all “figuring out” of what driver goes with what system.

        Perhaps a look at documentation will help. This contains information about a third program called System Update, but there are relevant chapters on Update Retriever and Thin Installer. The english variant is towards the bottom of the list.
        http://support.lenovo.com/en_US/downloads/detail.page?DocID=UM006719

      2. Robert
        i do not see anywhere you can setup seperate folders foreach machine. Did you mean that I should go an manully dowanload an extract eact type to it’s own folder? Or is there a setting where I can choose to extract each one to it’s own folder? And is it trying to install during extraction versus simple extraction like the script does? i still hold my opinion that Lenovo is not corporat grade.

  4. The Export option seems nice but it is buggy. When I tried it on my system it actually tries to install the drivers instead of just extracting them. It eventually hung up and I had to kill it in task manager.

    Once example is the Conexant Audio drivers. Are there some drivers/software that you aren’t supposed to use with the Export?

  5. I know this is sort of old, but…
    Lenovo uses type as model, so T410 will not work, when entering a type like 4178, everthhing gets extracted, and there is no OS seperation or x86 / x64. How do I achieve that?

    1. With Update Retriever, the original pull of drivers is under your control…if you want 32bit drivers, pick that, 64bit, pick those…but note that some application/driver packages for some items are effectively “combined” (there is only one package for either 32bit or 64bit), so this becomes complicated.

      If you PULL the drivers with Update Retriever, but APPLY the drivers with Thin Installer, it will automatically only apply the correct, relevant driver for a given OS.

      1. There is now another method for SCCM/MDT integration on the latest Thinkpads…SCCM driver packs. Note that these are large files…

        SCCM package for Windows 7 (32-bit) and (64-bit) – ThinkPad X230, X230i, X230 Tablet and X230i
        This package provides the device drivers in .inf form for ThinkPad computers, in order to allow you to deploy Windows images with Microsoft System Center Configuration Manager (SCCM) by importing the device drivers. Supported systemsThinkPad X230, X230i, X230 Tablet, X230i
        http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS030230

        SCCM package for Windows 7 (32-bit) and (64-bit) – ThinkPad T430, T430i, T430s, T430si, T530,
        This package provides the device drivers in .inf form for ThinkPad computers, in order to allow you to deploy Windows images with Microsoft System Center Configuration Manager (SCCM) by importing the device drivers. Supported systemsThinkPad T430, T430i, T430s, T430siThinkPad T530, T530iThinkPad (/SupportPages,SupportPage)
        http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS030226

        SCCM package for Windows 7 (32-bit) and (64-bit) – ThinkPad L430 and L530
        This package provides the device drivers in .inf form for ThinkPad computers, in order to allow you to deploy Windows images with Microsoft System Center Configuration Manager (SCCM) by importing the device drivers. Supported systemsThinkPad L430 ThinkPad L530
        http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS030227

        SCCM package for Windows 7 (32-bit) and (64-bit) – ThinkPad X131e
        This package provides the device drivers in .inf form for ThinkPad computers, in order to allow you to deploy Windows images with Microsoft System Center Configuration Manager (SCCM) by importing the device drivers. Supported systemsThinkPad X131e
        http://support.lenovo.com/en_US/downloads/detail.page?DocID=DS030229

  6. Am I completely dumb ? I really can’t see how Lenovo Update Retreiver and this script can help you with SCCM drivers integration. When I use Update Retreiver, I get useless .exe files. I just need .inf files to manage drivers packages through SCCM.
    Did I miss something ?

    1. Laky, first download the useless exe’s. Change this part of the script to point to the folder with exe’s and the folder the waht the inf’s in:

      ModelType = “T410”
      PackagePathRoot = “C:\” & ModelType & “\”

      Then run the script – cscript c:\[path]\”whatever you named the script”.vbs

  7. Ok, I gave the idea of using the Lenovo tools to Kenny. I also showed him through a TS how to manage it.
    Your script is nice but only for one shot. What if the drivers have been updated??? You cannot import the newest drivers into the driver list. It is unmanageable. What you can do is to just copy the executable files of Thininstaller and set in the config files whereto the drivers are. In that way the computer can do full update of his drivers. No hassle in updating, extracting, downloading drivers from the Lenovo site but just by using system retriever en thininstaller.
    Also for those who uses the lenovo sccm packages, they are not up to date. Got several times when the single driver download is more recent that what’s inside the sccm package so be warned about those. Better is to use the system retriever to get it and use Richard’s script if you want to work with the ‘import drivers’ method.
    For me the thininstaller method is way simpler to manage before and after. If you only have 4 or 5 Lenovo models it’s ok to use the script method.

  8. Am i doing something wrong here?
    I downloaded the updates that i needed for the T500..
    Changed the:

    objStartFolder =
    ModelType =
    PackagePathRoot =

    And started the script..
    but its more like it gives it the prober name and unpacks it..

    and it doesnt give me the .INF i need for the MDT deployment?

  9. The idea is to try and automate some of the process. Instead of using Kenny Buntinx’s recommendation of running the Lenovo thininstaller programme from within a task sequence after downloading all drivers via the Update retriever, I have written a script that extracts the executables.

  10. The current version of the Lenovo Update Retriever software (which can download drivers for a given system, giving you a “current” pull of drivers) has an “export” ability now…it extracts the drivers for a given machine type to a subdirectory of your choice, fully extracted, with an easy to understand subdirectory structure…you can directly import the plug and play drivers (not the apps, plug and play drivers) using this with MDT/SCCM.
    http://support.lenovo.com/en_US/research/hints-or-tips/detail.page?LegacyDocID=TVAN-ADMIN#ur

    1. Some of these links are outdated now…
      SCCM driver packs, generally updated quarterly, full packages:
      http://support.lenovo.com/us/en/documents/ht074984

      New link to DriverGrabber, which can do a raw grab of drivers if given a four digit machine type in caps (no lower case): http://support.lenovo.com/us/en/documents/ht100638

      Link to Update Retriever, which can create an exportable set of drivers for a given system for SCCM: http://support.lenovo.com/us/en/documents/ht037099#ur

      Link to Thin Installer, a command line driven “robot” that can automatically update drivers from a repository created by Update Retriever:
      http://support.lenovo.com/us/en/documents/ht037099#ti

  11. Thank you. Really useful script.

    I find Lenovo’s retriever very restrictive:

    1) you cannot specify to only download 64 BIT versions (and 32/64) ie excluding only 32 bit.

    2) you manually need to eyeball BIOS updates, Windows updates which break ThinInstaller. Which there was a way to automatically exclude those. Equally automatically only select drivers and not the various bundled apps.

    3) Really frustrating you have to download a huge catalogue of drivers for a type digits 1-4 and can’t specify the machine revision i.e. Type number digits 5-7.

    However your script is a great starting place. I have built an offline SCCM type solution which runs from a USB pen drive. So now want to during the initial phase which copies ONLY the necessary apps and drivers to save time to also get it to parse Lenovos offline driver respository and only copy what is required.

Leave a reply to Tyler Cancel reply