MDT custom variable for Lenovo Model – DriverGroup

The MDT Environment variable Model on lenovo machines returns something like 4158WNE instead human readable string, let says “ThinkStation D20”.
For Dell Machines Model=Dell DXP061 which facilitates using the Model variable directly for DriverGroup
Fortunately we can do the same for Lenovo Models by retrieving Version from Win32_ComputerSystemProduct WMI Class.
Lets modify the ZTIGather.wsf file which generates the MDT variables.

Result, Now we have an extra MDT variable with the right string we want. 😉

Create the required Driver Folder structure

Add the following lines to CustomSettings.ini
DriverSelectionProfile=Nothing
DriverGroup001=%Make%\%LenovoModel%

Modified ZTIGather.wsf can be downloaded here.

Join the Conversation

8 Comments

  1. Hello Siva,
    Thanks a lot for making the file available.
    I tried the solution. It doesn’s work for me though. Not sure what I am doing wrong.
    When I put your code in the ZTIGather.wsf I am running into errors in the deployment summary. I also copied your whole file, but that did not help me either.
    Not sure it is because I am having Win7 x64. Can I still use Win32_Computer_SystemProduct (apologies my ignorance)? I determined from your ZTIgather.wsf that I also need to add the “Dim slenovoModel” line and the line “oEnvironment.Item(“LenovoModel”)=sLenovoModel”. I noticed the error “rule Priority key not set in secion [Settings]” in my Deployment summary window. Are the two lines you mention in the customsettings.ini sufficient? Would be really great if you have an idea. I kind of struggled with an empty task sequence window earlier in the day, but this is kind of solved.
    Greetings
    Jörg

  2. Siva, I have adapted what you have above to be able to use this %LenovoModel% variable for the Deployment Databse too. A word of caution though that although this situation probably should not be allowed to happen, I discovered that should you not have the model in the the database, MDT will attempt to install any and all settings for any other models for Lenovo. this is easily fixed by making sLenovoModel “NULL” rather than a blank string at this point:
    if sLenovoModel = “” then
    sLenovoModel = “NULL”
    oLogging.CreateEntry “Unable to determine LenovoModel tag via WMI.”, LogTypeInfo
    End if
    Also, I have now successfully customised this method in my deployments for Panasonic Toughbooks which have a similar issue to Lenovos with regards to the Model though it utilises the MDT internal variable %Product% rather than the %LenovoModel% created by your edited ZTIGather.
    I have even tidied up the driver section with this:
    I have in my TS, a custom section in the Preinstall phase, just before the “Inject Drivers” task. This section has 3 tasks at present, though it can be expanded if required.
    Task 1 is for most make/models and sets DriverGroup001 to “Windows 7\%Make%\%Model%” IF %Model% DOES NOT equal either LENOVO or PANASONIC CORPORATION
    Task 2 takes care of Lenovo Models, it sets DriverGroup001 to “Windows 7\%Make%\%LenovoModel% IF %Model% EQUALS LENOVO
    Task 3 applies to Panasonic models: DriverGroup001 = “Windows 7\%Make%\%Product%” IF %Model% EQUALS PANASONIC CORPORATION
    The “Inject Drivers” task is then set to the selection profile “Nothing” and set to “Install all drivers from the selection profile”
    The Drivers for all makes and models can then be controlled using the folder structure within the “out-Of-Box Drivers” section of MD and discreet sets created.
    Both of these methods can be used for the SQL Database so you can deploy applications by model (Which is why I first looked at this page.). You need to add a couple sections to your CS.ini. After the normal MMApps in your priority, add in LenovoModelApps and PanasonicModelApps then create these sections:
    [LenovoModelApps]
    DBID={YOUR DB USERNAME}
    DBPwd={YOUR DB PASSWORD}
    SQLServer={YOUR SQL SERVER}
    Port=1433
    Database=MDT
    Netlib=DBMSSOCN <- We have to use TCP/IP as Named Pipes only works if the SQL server is on the same subnet as your deployment server.
    SQLShare=Deployment$
    Table=MakeModelApplications
    Parameters=Make, LenovoModel
    LenovoModel=Model
    ParameterCondition=AND
    Order=Sequence
    [PanasonicModelApps]
    DBID={YOUR DB USERNAME}
    DBPwd={YOUR DB PASSWORD}
    SQLServer={YOUR SQL SERVER}
    Port=1433
    Database=MDT
    Netlib=DBMSSOCN
    SQLShare=Deployment$
    Table=MakeModelApplications
    Parameters=Make, Product
    Product=Model
    ParameterCondition=AND
    Order=Sequence

  3. Hi there Siva, I have just tried this and the gather process seems to work good, though when I try to move the elements of your script into the latest ZTIGather.wsf from MDT 2012, no results are returned. Any idea what needs to be added/changed to get this working?

    1. Nevermind, just had to add oEnvironment.Item(“LenovoModel”) = sLenovoModel at line 636. Awesome, thanks!

Leave a comment

Leave a Reply to Rob Cancel reply

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

WordPress Appliance - Powered by TurnKey Linux