Zero Touch Installation Deployment Feature Team Guide

Appendix B: Customsettings.ini Reference

Published: August 27, 2005

ZTI requires the ability to dynamically determine how to proceed based on a set of rules. These rules are defined in a single configuration file named Customsettings.ini. The rules applied during the ZTI processing on a particular machine are based on:

Information obtained from the machine itself, such as MAC address, asset tag, machine GUID, TCP/IP default gateway, HAL, computer name, etc.

Information retrieved from one or more databases. Based on the machine information, it is possible to dynamically determine how the ZTI process should proceed.

Static information. If some information required for the ZTI process cannot be determined using the machine or database information retrieved, one or more sections (for example,. [Default]) can be used to fill in the missing values.

This Customsettings.ini file should be placed in the same directory as the main ZTI script, ZeroTouchInstallation.vbs. This script will read the contents of the file during the appropriate phase in the ZTI process.

On This Page
Configuring the [Settings] SectionConfiguring the [Settings] Section
Configuring the [SysprepInfMapping] SectionConfiguring the [SysprepInfMapping] Section
Configuring the [DefaultGateway] SectionConfiguring the [DefaultGateway] Section
Customizing Deployment Based On the Chassis TypeCustomizing Deployment Based On the Chassis Type
Configuring Custom SectionsConfiguring Custom Sections
Configuring Database SectionConfiguring Database Section

Configuring the [Settings] Section

The [Settings] section is the section that determines how the remainder of the Customsettings.ini file is processed. A typical [Settings] section is illustrated in Listing 36.

Note Some parts of the following code snippet have been displayed in multiple lines only for better readability. These should be entered in a single line.

[Settings]
Priority=MacAddress, DefaultGateway, Default 
CustomKeysUserData=UDShare, UDDir, UDProfiles, 
SLShare, OSInstall, Packages(*), Administrators(*)
CustomKeysSysprep=ComputerName, TimeZone, JoinDomain
OSDVariableKeys=OSDINSTALLSILENT, OSDINSTALLPACKAGE,
OSDINSTALLPROGRAM, OSDNEWMACHINENAME
ScanStateArgs=/i:miguser.inf /i:migapp.inf 
/i:migsys.inf /i:sysfiles.inf /i:updateuser.inf
/v:7 /x /s /f /o /c
LoadStateArgs=/v:7 /c
UserExit=CustomScript.vbs

Listing 36. [Settings] section in Customsettings.ini

Note   All values should be included on one line. The lines wrap in this example are caused by the limitations of the document width.

The following are required values in the [Settings] section:

Priority

CustomKeysUserData

CustomKeysSysprep

OSDVariableKeys

ScanStateArgs

LoadStateArgs

The UserExit value is optional. Each of these sections is described in further detail later in this guide.

Priority

The Priority value determines the sequence and section of where to find configuration values. Each section will be searched in the order specified. Once all the required custom key values are found, the remaining sections are not used.

The supported values for Priority are listed in Table 46.

Table 46. Priority Key Values and their Description

Priority Key ValuesDescription

DefaultGateway

Each TCP/IP default gateway address (for example, 10.1.1.1) will be used to find a similarly-named section (for example, [10.1.1.1]) in the configuration file. The section does not have to exist. If it is found, it will be searched for custom key values not yet populated.

LocalDataName

Any local machine value known to the ZTI script can be used to identify a section name in the configuration file. For example, specifying “HostName” would cause the script to look for a section with the current machine name. Some values, like “MacAddress,” will result in multiple section names being checked, since a machine can have multiple MAC addresses. The values that can be specified for <LocalDataName> are: OSVersion, HALName, Hostname, AssetTag, SerialNumber, Make, Model, Product, UUID, IPAddress, MacAddress.

<CustomSection>

One or more specific section names can be specified. For example, if “MySection” were included in the Priority list, the [MySection] section would be searched for any custom key values not yet populated.

Example:

Priority=MacAddress, DefaultGateway, Default

CustomKeysUserData

This value defines the custom user data keys that must be populated for the ZTI process.

The supported values for CustomKeysUserData are listed in Table 47.

Table 47. CustomKeysUserData and Their Description

CustomKeysUserDataDescription

UDShare

Share to save User Data

UDDir

Directory under UDShare to save User Data

UDProfiles

User profile on local machine to save. You can specify multiple users by separating the users with a comma.

SLShare

Share to save log file from custom scripts.

OSInstall

Flag value to control the deployment process. This flag must be set to Y for an operating system image to be deployed to the machine. (If OSInstall is not listed in the CustomKeysUserData key list, images can be deployed to any machine.)

Packages(*)

A collection of package IDs and programs that should be installed on a machine during the State Restore Phase. The (*) designator marks this key as a collection, so values are added to the collection as they are encountered (building a list); duplicates are ignored. Values must be specified in the “NNN00000-Program” format, where “NNN00000” is the SMS package ID and Program is the SMS program name.

Administrators(*)

A collection of groups or users that should be added to the Administrators group (or the localized or renamed equivalent) on the deployed machine. The (*) designator marks this key as a collection, so values are added to the collection as they are encountered (building a list); duplicates are ignored.

PowerUsers(*)

A collection of groups or users that should be added to the Power Users group (or the localized or renamed equivalent) on the deployed machine. The “(*)” designator marks this key as a collection, so values are added to the collection as they are encountered (building a list); duplicates are ignored.

DriverPath or DriverPath(*)

The UNC path specified by this custom key will be copied to the local machines “\Drivers” directory. All “\Drivers” subdirectories will be scanned looking for drivers; any not already included in the Sysprep.inf’s “OemPnpDriverPath” value will be added to that path (subject to the 4096 character limit on this value).

ImageSize

The actual size of the OS image (contained in the OS.WIM file) which should be used instead of a size estimate.

ImageSizeMultiplier

If ImageSize is not specified, this value is used as a multiplier with the size of the OS image (contained in the OS.WIM file). The size will be multiplied by this value to get an estimated size at deployment. If not specified, a default value of 2.5 will be used (assuming 2.5X compression within the WIM file).

Example:

Note Some parts of the following code snippet have been displayed in multiple lines only for better readability. These should be entered in a single line.

CustomKeysUserData=UDShare, UDDir, UDProfiles,
SLShare, OSInstall, Packages(*), Administrators(*),
PowerUsers(*), DriverPath, ImageSize

CustomKeysSysprep

This value defines the data keys that will be used to update the Sysprep.inf file, which controls how the machine is initially configured when the operating system first starts up. Each value specified should correspond to a value in the Sysprep.inf file. The [SysprepInfMapping] section must contain one entry for each of these values which specifies the section of the Sysprep.inf file that contains the specific value.

A list of common values for CustomKeysSysprep are listed in Table 48. Any value can be supported; it just needs to be to defined on the CustomKeysSysprep line and in the [SysprepInfMapping] section.

Table 48. CustomKeysSysprep and Their Description

CustomKeysSysprepDescription

ComputerName

Computer name to be assigned to the workstation.

TimeZone

Time zone in which the workstations is located.

JoinDomain

Domain name of the domain to which the workstation will belong.

MachineObjectOU

Active Directory organization unit where the computer account of the workstation will be created.

Example:

Note Some parts of the following code snippet have been displayed in multiple lines only for better readability. These should be entered in a single line.

CustomKeysSysprep=ComputerName, TimeZone,
JoinDomain, MachineObjectOU

OSDVariableKeys

This value defines the data keys that are needed to automate or control the SMS 2003 OSD Feature Pack image installation process.

The supported values for OSDVariableKeys are listed in Table 49.    

Table 49. OSDVariableKeys and Their Description

OSDVariableKeysDescription

OSDINSTALLSILENT

This value must be set to a value (normally 1) to indicate that the SMS 2003 OSD Feature Pack Image Installation Wizard should not be displayed. In order for this to work properly, the next three values must be specified as well.

OSDINSTALLPACKAGE

This value specifies the SMS package ID (for example, SMS00001) for the OS package that should be installed on the machine.

OSDINSTALLPROGRAM

This value specifies the OS program name (for example, ZTI Install) within the specified OS package that should be executed. All ZTI custom actions should be defined as part of this OS program definition.

OSDNEWMACHINENAME

For new machines, this value must be populated so that the SMS 2003 OSD Feature Pack knows what name to assign to a new machine. This value can be set to * to indicate that Windows should generate a name during mini-setup; the value can then be overridden later in the process by ZTI through editing the Sysprep.inf file.

Example:

Note Some parts of the following code snippet have been displayed in multiple lines only for better readability. These should be entered in a single line.

OSDVariableKeys=OSDINSTALLSILENT, OSDINSTALLPACKAGE,
OSDINSTALLPROGRAM, OSDNEWMACHINENAME

ScanStateArgs

This value specifies the arguments that should be passed to the USMT Scanstate process. The ZTI script will determine which version of Scanstate to call (Scanstate.exe for Unicode systems, Scanstatea.exe for ANSI systems) and will insert the appropriate logging, progress, and state store parameters. If this value is not included in the settings file, the user state backup process will be skipped.

Example:

Note Some parts of the following code snippet have been displayed in multiple lines only for better readability. These should be entered in a single line.

ScanStateArgs=/i:miguser.inf /i:migapp.inf 
/i:migsys.inf /i:sysfiles.inf /i:updateuser.inf 
/v:7 /x /s /f /o /c

LoadStateArgs

This value specifies the arguments that should be passed to the USMT Loadstate process. The ZTI script will insert the appropriate logging, progress, and state store parameters. If this value is not included in the settings file, the user state restore process will be skipped.

If the Loadstate process completes successfully, the user state information is deleted. In the event of a Loadstate failure (or non-zero return code), the local state store is moved to %WINDIR%\StateStore to prevent deletion and ensure that no user state information is lost.

Example:

LoadStateArgs=/v:7 /c

UserExit

This value specifies the name of a script that should be called as part of the phase processing. This enables custom script functions to be called during the ZTI processing without modifying the main ZeroTouchInstallation.vbs script. It will be called twice:

After machine information has been gathered but before the processing for this particular phase has been performed. In this case, the exit can set a parameter (bSkip) to indicate that the remaining process for this phase should be skipped.

After the normal processing for the phase has been completed, allowing the exit to change any of the values retrieved.

A sample user exit function written in VBScript can be seen in Appendix F: Sample User Exit Function, later in this guide.

Note   You need to include any user exit scripts in the OldComputer package source directory so that they can be accessed when it is time for the user exit script to be run.

Example:

UserExit=MyUserExit.vbs

Configuring the [SysprepInfMapping] Section

The [SysprepInfMapping] section, as illustrated in Listing 37,is required so that ZTI knows how to edit the Sysprep.inf file using the custom key values defined previously. Since each value could exist in one of several Sysprep.inf sections, it is necessary to indicate which section contains the value.

[SysprepInfMapping]
ComputerName=UserData
TimeZone=GuiUnattended
JoinDomain=Identification
MachineObjectOU=Identification

Listing 37. [SysprepInfMapping] section in Customsettings.ini

In each case the syntax is as follows and described in Table 50:

<CustomKeyName>=<SysprepInfSection>

Table 50. [SysprepInfMapping] Values and Their Description

SysprepMapping ValueDescription

<CustomKeyName>

The name specified (for example, “ComputerName”) must match one of the custom key names defined in the [Settings] section. It will also be used as the name in the Sysprep.inf file.

<SysprepInfSection>

The value specified (for example, “UserData”) indicates the section name in the Sysprep.inf file (in this case, “[UserData]”).

Configuring the [DefaultGateway] Section

The [DefaultGateway] section, as illustrated in Listing 38, is used to provide “friendly” names for each TCP/IP default gateway value found on a computer. This allows multiple default gateway addresses to point to a single section name. If an entry is not found in the [DefaultGateway] section for a particular TCP/IP default gateway value, that default gateway will be ignored. A typical [DefaultGateway] section may look like this:

[DefaultGateway]
10.1.1.1=MainOffice
10.2.1.1=RemoteOffice

Listing 38. [DefaultGateway] section in Customsettings.ini

In each case the syntax is as follows and described in Table 51:

<DefaultGatewayAddress>=<CustomSection>

Table 51. [DefaultGateway] Values and Their Description

SysprepMapping ValueDescription

< DefaultGatewayAddress >

The value specified (for example, “10.1.1.1”) is a TCP/IP default gateway address on the current machine.

< CustomSection >

For the default gateway address specified (for example, “10.1.1.1”) the specified custom section name (for example, “MainOffice”) should be used to get ZTI custom key settings.

Customizing Deployment Based On the Chassis Type

You can customize your deployment based on the chassis type of the computer (such as laptop, desktop, or server). The ZeroTouchInstallation.vbs script creates local variables that can be processed in the CustomSettings.ini file or in the AdminDB database. The local variables IsLaptop, IsDesktop, and IsServer indicate whether the computer is a laptop, desktop, or server, respectively.

Note   In previous versions of ZTI, the IsServer flag indicated that the existing operating system is a server operating system (such as Windows Server 2003, Enterprise Edition). This flag has been renamed to IsServerOS.

The method for implementing these variables in the CustomSettings.ini file is as follows:

1.

In the [Settings] section, on the “Priority” line, add a custom section to customize deployment based on the chassis type (ByType in the example in Listing 39).

2.

Create the custom section that corresponds to the custom section defined in the Step 1 ( [ByType] in the example in Listing 39).

3.

Define a subsection for each of the chassis types that you want to detect (Subsection=Laptop-%IsLaptop%, Subsection=Desktop-%IsDesktop%, Subsection=Server-%IsServer% in the example in Listing 39).

4.

Create a subsection for each True and False state of each subsection defined in Step 3 (such as [Laptop-True], [Laptop-False] [Desktop-True], [Desktop-False] in the example in Listing 39)

5.

Under each True and False subsection, add the appropriate settings based on the chassis type.

 
[Settings]
 
Priority=MacAddress, DefaultGateway, ByType
    .
    .
    .
 
[ByType]
Subsection=Laptop-%IsLaptop%
Subsection=Desktop-%IsDesktop%
Subsection=Server-%IsServer%
    .
    .
    .
 
[Laptop-True]
    .
    .
    .
 
[Laptop-False]
    .
    .
    .
 
[Desktop-True]
    .
    .
    .
 
[Desktop-False]
    .
    .
    .
 
[Server-True]
    .
    .
    .
 
[Server-False]
    .
    .
    .
 

Listing 39. Example of Customizing Deployment Based On Chassis Type in the CustomSettings.ini File

Configuring Custom Sections

Custom sections, as illustrated in listing, are used to specify the actual custom key values that should be used, to specify the database that should be used to retrieve the custom key values, or both. A typical custom section may look like this:

[00:03:FF:CB:4E:C2]
UDShare=\\SERVER\MigData
SLShare=\\SERVER\Logs
OSDINSTALLSILENT=1
OSDINSTALLPACKAGE=SMS00001
OSDINSTALLPROGRAM=ZTI Install
OSDNEWMACHINENAME=WasWIN2000PRO
ComputerName=WasWIN2000PRO
TimeZone=004

Listing 40. [SysprepInfMapping] section in Customsettings.ini

Each name specified corresponds to a custom key value specified in the [Settings] section; the value specified is then assigned to that custom key, but only if that custom key does not already have a value (so the first match from any custom section is used). Any custom key names not specified will not be changed.

The following optional special keys can also be specified:

The SQLDefault key instructs the ZTI scripts to use the values in the section indicated to connect to SQL Server to look for custom key values; any values retrieved from SQL Server will be used before considering any specific values in the custom settings section (considered “fallback” values if no database match is found). See the next section for a description of a database section.

The UserExit key specifies the name of a script that should be called before processing this section. This enables custom script functions to be called during the ZTI processing without modifying the main ZeroTouchInstallation.vbs script.

The “Subsection” key specifies the name of another section that should be checked for custom key values. The value of the “Subsection” key can include variables, e.g. “%Model%”, which will automatically be replaced with the actual value.

In each case the syntax is as follows and described in Table 52:

[<CustomSection>]
SQLDefault=<SQLSection>
UserExit=<UserExitScriptFile>
Subsection=<CustomSectionWithVariables>
<CustomKeyName>=<KeyValue>

Table 52. CustomSection Values and their Description

CustomSection ValueDescription

<CustomSection>

The name of the custom section.

SQLDefault

An optional value specifying the name of a database section that specifies the information necessary for connecting to SQL Server to retrieve custom key values.

UserExit

Specifies the name of a script that should be called as part of the section processing. This enables custom script functions to be called during the ZTI processing without modifying the main ZeroTouchInstallation.vbs script. It will be called twice:

Before any values have been read from the .ini file section or database. In this case, the exit can set a parameter (bSkip) to indicate that the remaining processing for this section should be skipped.

After the normal processing for the section has been completed, allowing the exit to change any of the values retrieved.

Example:

UserExit=MyUserExit.vbs

For an example of a sample user exit function written in VBScript, see Appendix F: Sample User Exit Function, later in this guide.

Subsection

Specifies a subsection that should also be checked for further values, with all variables automatically replaced with the proper value. This allows the CustomSettings.ini to represent more complex “and” conditions between multiple variables.

Example:

[Settings]
Priority=Make
  
[Dell Computer Corporation]
Subsection=Dell-%Model%
  
[Dell-Latitude D600]
CustomKeyName=CustomKeyValue 

<CustomKeyName>

One of the custom key names specified in the [Settings] section.

<KeyValue>

The value that should be assigned to the specified custom key name (assuming the custom key does not already have a value).

Configuring Database Section

To offer the greatest level of flexibility, the ZTI scripts can query SQL Server to obtain values for custom key settings specified in the [Settings] section. To query SQL Server, more information is needed such as the name of the server, the database on that server, the name of the table, and details of the table structure. All of these values can be specified in a database section.

Multiple database sections can be specified, each with different SQL Server information, further enhancing the flexibility.

One special database section, named “[SMS]” must be defined if packages are specified above; this special section is used to resolve SMS package IDs and program names to command lines. For OSD to install packages during the post-install phase, OSD needs the following information for each package:

Package ID

Program name

Program command line

The package ID and program name values are specified when populating the "Packages(*)" custom key. The ZeroTouchInstallation.vbs script can use those values to query the SMS database for the package installation command line. For the script to do this, the script reads the SMS database information from the [SMS] database section in the CustomSettings.ini file, as shown in Listing 41. Packages deployed in this manner are known as dynamic packages. If the [SMS] section is not present, it is not possible to install dynamic packages.

[SMS]
SQLServer=SMSSERVERNAME
Database=SMS_XXX
Table=v_Program
Parameters=PackageID,ProgramName
SQLShare=Logs

Listing 41. Example of the [SMS] database section

The [SMS] section needs to include the appropriate server name, database name, and share name (as SQLServer, Database, and SQLShare variables, respectively. The Table and Parameters values should always be the values illustrated in Listing 41.

Note   You need to ensure the appropriate permissions are granted to the SMS database and the v_Program view. (The Table and Parameters should not be changed.)

In each case the syntax is as follows and described in Table 53:

[<CustomSection>]
SQLDefault=<SQLSection>
UserExit=<UserExitScriptFile>
<CustomKeyName>=<KeyValue>

A typical database section may appear as follows:

[BDDAdminDB]
SQLServer=SERVER01
Database=BDDAdminDB
Table=BDDAdminCore
Parameters=MacAddress
SLShare=ScriptLogShare

In this particular case, the ZTI scripts will connect to database “BDDAdminDB” on server “SERVER01” and query table “BDDAdminCore” using the “MacAddress” custom key as the database query criteria (matched up with the appropriate database column ID). Additionally, a column name translation is specified: the “SLShare” custom key name should be matched up with the “ScriptLogShare” database column. The SQL query that would be generated as a result of this would be:

Note Some parts of the following code snippet have been displayed in multiple lines only for better readability. These should be entered in a single line.

SELECT * FROM BDDAdminCore WHERE MacAddress IN
('00:00:00:00:00:00','11:11:11:11:11:11')

The following example shows multiple parameters being specified:

[BDDAdminDB]
SQLServer=SERVER01
Database=BDDAdminDB
Table=BDDAdminCore
Parameters=Make, Model

This would result in the following SQL statement:

Note Some parts of the following code snippet have been displayed in multiple lines only for better readability. These should be entered in a single line.

SELECT * FROM BDDAdminCore WHERE
Make = 'Acme' and Model = 'CorporatePC' 

In the case of a stored procedure, the results would be slightly different:

[BDDAdminDB]
SQLServer=SERVER01
Database=BDDAdminDB
StoredProcedure=spBDDAdmin
Parameters=Make, Model

This would result in the following SQL statement:

EXECUTE spBDDAdmin 'Acme', 'CorporatePC' 

The general syntax of a database section is:

[<DatabaseSection>]
SQLServer=<SQLServerName>
Database=<SQLDatabaseName>
Table=<SQLTableName>
StoredProcedure=<SQLStoredProcedureName>
Parameters=<Any local key or custom key>
UseEncryptedFile=<True | False>
EncryptedFile=<EncryptedFileName>
DomID=<DomainUserID>
DomPwd=<DomainPassword>
DBID=<DatabbaseUserID>
DBPwd=<DatabasePassword>
<CustomKeyName>=<SQLColumnName>

Table 53. DatabaseSection Values and Their Description

SysprepMapping ValueDescription

< DatabaseSection >

The name of the database section.

SQLServer

The name of the server (for example, “SERVER01”) that is running SQL Server.

Database

The name of the SQL Server database (on the specified server, for example, “BDDAdminDB”) that should be used.

Table

The name of the SQL Server table (on the specified server and database, for example, “BDDAdminCore”) that should be queried. If a “StoredProcedure” value is specified, a “Table” value cannot be specified.

StoredProcedure

The name of the SQL Server stored procedure (on the specified server and database, for example, “BDDAdminCore”) that should be executed. If a “Table” value is specified, a “StoredProcedure” value cannot be specified.

Parameters

The custom key or local key values that should be used when querying the database. Multiple values can be specified, separated by commas. If the key specified has multiple values (for example, “MacAddress”), an “IN” clause will be added to a table query, but only the first value will be used when calling the stored procedure.

DBID

This optional value specifies a SQL Server user ID needed for making a “standard security” or “SQL security” connection to the database. If not specified, an “integrated security” (or “Windows security”) connection will be made. If an encrypted file is being used, the value will be retrieved from that file instead.

DBPwd

This optional value specifies the password that corresponds to the SQL Server user ID specified. If an encrypted file is being used, the value will be retrieved from that file instead.

<CustomKeyName>

This specifies the name of the custom key that needs to be remapped into a different SQL Server column.

<SQLColumnName>

The SQL Server column name that should be used instead of the custom key name.


Top of pageTop of pagePrevious13 of 25Next
**
In This Article
**