Variations on model numbers and names can exist with virtually no difference in the driver set. These variations in model numbers and names can unnecessarily increase time spent making multiple database entries for a given model. The following procedure shows how to define a new property using a user exit function call that returns a substring of the model number.

To create model aliases

1.   Click Start, and then point to All Programs. Point to Microsoft Deployment Toolkit, and then click Deployment Workbench.

2.   In the Deployment Workbench console tree, go to Deployment Workbench/Deployment Shares/deployment_share (where deployment_share is the name of the deployment share to configure).

3.   In the Actions pane, click Properties.

4.   In the Properties dialog box, click the Rules tab.

5.   Create aliases for hardware types in the Make and Model sections of the MDT DB. Truncate the model type at the open parentheses “(” in the model name. For example, HP DL360 (G112) becomes HP DL360.

6.   Add the custom variable ModelAlias to each section.

7.   Create a new [SetModel] section.

8.   Add the [SetModel] section to the Priority settings in the [Settings] section.

9.   Add a line to the ModelAlias section to refer to a user exit script that will truncate the model name at the “(”.

10. Create an MMApplications database lookup where ModelAlias is equal to Model.

11. Create a user exit script and place it in the same directory as the CustomSettings.ini file to truncate the model name.

Listing 12 and Listing 13 show CustomSettings.ini and the user exit script, respectively.

Listing 12. CustomSettings.ini

[Settings]

Priority=SetModel, MMApplications, Default

Properties= ModelAlias

[SetModel]

ModelAlias=#SetModelAlias()#

Userexit=Userexit.vbs

[MMApplications]

SQLServer=Server1

Database=MDTDB

Netlib=DBNMPNTW

SQLShare=logs

Table= MakeModelSettings 

Parameters=Make, ModelAlias

ModelAlias=Model

Order=Sequence

 

Listing 13. User Exit Script

Function UserExit(sType, sWhen, sDetail, bSkip)

  UserExit = Success

End Function

 

Function SetModelAlias()

  If Instr(oEnvironment.Item("Model"), "(") <> 0 Then

    SetModelAlias = Left(oEnvironment.Item("Model"), _

                      Instr(oEnvironment.Item("Model"), _

                        "(") - 1)

    oLogging.CreateEntry "USEREXIT – " & _

      "ModelAlias has been set to " & SetModelAlias, _

      LogTypeInfo

  Else

    SetModelAlias = oEnvironment.Item("Model")

    oLogging.CreateEntry " USEREXIT - " & _

      "ModelAlias has not been changed.", LogTypeInfo

  End if

End Function


Related Topics

Microsoft Deployment Toolkit Samples Guide