none
Restrict unsupported models in MDT RRS feed

  • Question

  • How can i restrict models that are not supported in our environment? If we allow a Dell GX780 and a Lenovo T400 how can I only have those two models work with MDT and if someone tries to build another model it will throw up an error or fail?
    Thursday, February 25, 2010 6:48 PM

Answers

  • if you want to verify from the DB you might need to create a list variable and populate it with a custom DB query from the database, then compare to that, the sample i gave above you would essentially "maintain" inside of the userExit in static-text.  As you can't parse DB queries the same way from VBScript in WinPE you'd want to query to complie a list of supported models from the customsettings, then parse that list var in your userexit.


    Sooo something like this in customsettings.ini..

    [Settings]
    Priority=GetModels, Default
    Properties=ModelList(*)

    [GetModels]
    SQLServer=MDTServer
    Instance=SQLEXPRESS
    Database=MDT1
    Netlib=DBNMPNTW
    SQLShare=PXEImages
    Table=MakeModelIdentity
    ModelList=Model

    (You may need to modify this query to populate a list item.... i think it would populate properly i've never used an Alias parameter with a list item.. in theory its accurate i thnk)


    Then in you script something like..:



    Function UserExit(sType, sWhen, sDetail, bSkip)
    SupportedModels
    UserExit = SupportedModels
    End Function

    Function SupportedModels(sModel)
    For Each suppmodel In oEnvironment.ListItem("ModelList")
       If InStr(UCase(suppmodel), oEnvironment.Item("Model") > 0
    SupportedModels=Success
    Else
    SupportedModels=Failure
    End If
     Next
    End Function







    -Dustin
    Thursday, February 25, 2010 8:55 PM
  • Another option without UserExit script is to configure the property "OSInstall" for each supported Model with "YES" (or "Y") in the database. That will actually happen on default if you create a new MakeModel in the Database. OSInstall is a default property in MDT and MDT will only execute, if this property is set to YES. And it is configured in a way that it can't be overwritten. So the first value wins. 

    Now in your cs.ini your first query for the MakeModel specific settings. After that you try to set OSInstall to NO. This will set the property to YES if a Model exists already and is supported, and will default all others to NO. 

    Your customsettings.ini could look like:

    [Settings]
    Priority=MakeModelSettings, NoInstall, .. myotherdatabasequeriesandconfigurationsections ....

    [NoInstall]
    OSInstall=NO

    [MakeModelSettings]
    SQLServer=YourSQLServer
    Database=YourMDTDatabase
    Netlib=DBNMPNTW
    SQLShare=YourSQLServerShare
    Table=MakeModelSettings
    Parameters=Make, Model

    Regards

    Maik


    http://myitforum.com/cs2/blogs/maikkoster/default.aspx

    • Marked as answer by Jfattizzi Tuesday, March 2, 2010 1:23 PM
    Friday, February 26, 2010 8:17 AM

All replies

  • you could use a userexit script, and return a failure code if the model isn't in the 
    this is off the top of my head so if its slightly inaccurate you may need to research/modify..


    Function UserExit(sType, sWhen, sDetail, bSkip)
    SupportedModels
    UserExit = SupportedModels
    End Function

    Function SupportedModels(sModel)
    If InStr(UCase(oEnvironment.Item("Model")), "DELL E6400") <> 0
    SupportedModels=Success
    Else
    SupportedModels=Failure
    End If
    End Function

    -Dustin
    Thursday, February 25, 2010 7:21 PM
  • How would the script look if the model someone was trying to build wasnt in the database?

    Thursday, February 25, 2010 7:46 PM
  • if you want to verify from the DB you might need to create a list variable and populate it with a custom DB query from the database, then compare to that, the sample i gave above you would essentially "maintain" inside of the userExit in static-text.  As you can't parse DB queries the same way from VBScript in WinPE you'd want to query to complie a list of supported models from the customsettings, then parse that list var in your userexit.


    Sooo something like this in customsettings.ini..

    [Settings]
    Priority=GetModels, Default
    Properties=ModelList(*)

    [GetModels]
    SQLServer=MDTServer
    Instance=SQLEXPRESS
    Database=MDT1
    Netlib=DBNMPNTW
    SQLShare=PXEImages
    Table=MakeModelIdentity
    ModelList=Model

    (You may need to modify this query to populate a list item.... i think it would populate properly i've never used an Alias parameter with a list item.. in theory its accurate i thnk)


    Then in you script something like..:



    Function UserExit(sType, sWhen, sDetail, bSkip)
    SupportedModels
    UserExit = SupportedModels
    End Function

    Function SupportedModels(sModel)
    For Each suppmodel In oEnvironment.ListItem("ModelList")
       If InStr(UCase(suppmodel), oEnvironment.Item("Model") > 0
    SupportedModels=Success
    Else
    SupportedModels=Failure
    End If
     Next
    End Function







    -Dustin
    Thursday, February 25, 2010 8:55 PM
  • Another option without UserExit script is to configure the property "OSInstall" for each supported Model with "YES" (or "Y") in the database. That will actually happen on default if you create a new MakeModel in the Database. OSInstall is a default property in MDT and MDT will only execute, if this property is set to YES. And it is configured in a way that it can't be overwritten. So the first value wins. 

    Now in your cs.ini your first query for the MakeModel specific settings. After that you try to set OSInstall to NO. This will set the property to YES if a Model exists already and is supported, and will default all others to NO. 

    Your customsettings.ini could look like:

    [Settings]
    Priority=MakeModelSettings, NoInstall, .. myotherdatabasequeriesandconfigurationsections ....

    [NoInstall]
    OSInstall=NO

    [MakeModelSettings]
    SQLServer=YourSQLServer
    Database=YourMDTDatabase
    Netlib=DBNMPNTW
    SQLShare=YourSQLServerShare
    Table=MakeModelSettings
    Parameters=Make, Model

    Regards

    Maik


    http://myitforum.com/cs2/blogs/maikkoster/default.aspx

    • Marked as answer by Jfattizzi Tuesday, March 2, 2010 1:23 PM
    Friday, February 26, 2010 8:17 AM
  • This way worked perfectly without too much work.  Thank You.
    Tuesday, March 2, 2010 1:23 PM