ConfigMgr

Back to Basic – CustomSettings.ini – Converting Model and ModelAlias into Roles

So, someone asked me(you know who you are) if it is possible to convert something like a computer model into a role, and yes that is possible and some times a pretty smart thing to do. It becomes really great if you are using the ModelAlias Userexit script and you would like to use the database to define settings. The database has support for make and model, but since you are using modelalias instead of make and model, well then you can define settings as a role instead. The only thing you need to do is to convert the ModelAlias value into a Role and you are done. In this post I will describe two scenarios, one when you convert model into a role and the other is when you turn the modelalias into a role.

Converting Model into a Role:

In the customsettings.ini file we have three sections in the priority line: ConvertModelToRole,Role,Default and one customproperty just for fun

  1. ConvertModelToRole – will set the Role001 into RoMo-“the return of the model”
  2. Role – will search for a section with the name of RoMo-“the return of the model”
  3. Default – set default values

image
Sample CustomSettings.ini file

image
The output when running ZTIGather.wsf to test the inifile.

Converting ModelAlias into a role:

In the customsettings.ini file we have four sections in the priority line: HardwareInfo,ConvertModelToRole,Role,Default

  1. HardwareInfo – will execute the modelalias userexit script and return a value from that script
  2. ConvertModelToRole – will set the Role001 into RoMo-“the return of the model alias user exit script result”
  3. Role – will search for a section with the name of RoMo-“the return of the model alias user exit script result”
  4. Default – set default values

image
Sample CustomSettings.ini file

image
The output when running ZTIGather.wsf to test the inifile.

You can download the sample ini files here: http://1drv.ms/1LiIw7H

The UserAlias Userexit script is here: http://1drv.ms/1LiIVHh

Instructions on how to test customsettings.ini is here:https://anothermike2.wordpress.com/2011/04/27/quick-and-dirty-testing-customsettings-ini-variables-in-mdt/

/mike

Categories: ConfigMgr, MDT, OSD

Tagged as: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.