Appendix A: Creating Model Aliases

Variations on model numbers and names can exist but with virtually no difference in the driver set. Nonetheless, the variation in model numbers and names would 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. Create aliases for hardware types in the Make and Model sections of the database. Truncate the model type at the “(“ in the model name. For example, "HP DL360 (G112)" becomes "HP DL360".

  2. Add the custom variable ModelAlias to each section.

  3. Create a new [SetModel] section.

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

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

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

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

Listing 1 and Listing 2 show CustomSettings.ini and the user exit script, respectively.

Listing 1. Customsettings.ini

[Settings] 
Priority=SetModel, MMApplications, Default 
Properties= ModelAlias 
[SetModel] 
ModelAlias=#SetModelAlias()# 
Userexit=Userexit.vbs 
[MMApplications] 
SQLServer=AHSL99 
Database=YOURAdminDB 
Netlib=DBNMPNTW 
SQLShare=logs 
Table= MakeModelSettings  
Parameters=Make, ModelAlias 
ModelAlias=Model 
Order=Sequence

Listing 2. 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 

Download

Get the Microsoft Deployment Solution Accelerator

Update Notifications

Sign up to learn about updates and new releases

Feedback

Send us your comments or suggestions