Template variables allow for greater portability and
customizability in templates. For example, a template may
contain very specific file names to copy, paths to install to,
or an IP address to export files from, but with user variables in
place of these specific items, the template can address more
situations or locales because you can simply swap out the variables
in the XML code to replace those specific items.
There are four types of variables. They are (in order of
precedence)
Device: Variables assigned to a specific
device
Global: Variables that are public (available)
to all templates
Template: Variables applying only to the
assigned template
Action: Variables applying only to a specific
action
NOTE: Variables are
case-sensitive.
To define a device variable
In the All devices list, right-click a device
and select Manage variables.
Type the name of the item (such as IP address) in the
Name
box.
Type the value to be replaced in the Value
box.
Select the type.
String: Enter a string value
Database value: Enter a database ID string,
such as Computer.Network."NIC Address"
Sensitive data: Enter the value to be
encrypted in the database.
NOTE: Use quotation
marks around names with spaces. Most values from the Inventory
database can be used.
Click Save.
To define a public (global) variable
Click Tools > Distribution > OS
Deployment.
On the toolbar, click the Public variables
button.
To add a variable, click Add.
Type the variable you want to add in the Search
value
box (for example, CoreIP).
Type the value you want to replace in the
Replacement value
box (for example, if the search value is CoreIP, type the IP
address you want to replace CoreIP with).
Select the type.
String: Enter a string value
Database value: Enter a database ID string,
such as Computer.Network."NIC Address"
Sensitive data: Enter the value to be
encrypted in the database.
NOTE: Use quotation
marks around names with spaces. Most values from the Inventory
database can be used.
Click OK.
Creating unique identifiers for new devices
To create unique identifiers for new devices, use a Public
variable that is based on the MAC address of the target device as
shown below:
Variable
(Database) =macAddress
Value =
Computer.Network."NIC Address"
Variable
(String) = Prefix
Value = UT
(User value like location - Optional)
Variable
(String) = Suffix
Value = XP
(User value like OS - Optional)
Variable
(String) = ComputerName
Value =
%Prefix%%MACaddr%%Suffix%
Next, use the ComputerName variable in your sysprep.inf or
unattend.txt files to uniquely identify the new device, as shown in
the following code sample.
[UserData]
ProductKey=%ProductKey%
FullName="Engineering"
OrgName="LANDesk"
ComputerName=%ComputerName%
To define a template variable
Click Tools > Distribution > OS
Deployment.
Under Provisioning templates, click
Public or My templates to display a list of
templates.
Double-click a template to open the Template
view.
Click Template variables.
Click Add.
Type the variable you want to add in the Search
value
box.
Type the value you want to replace in the
Replacement value
box.
Select the type.
String: Enter a string value
Database value: Enter a database ID string,
such as Computer.Network."NIC Address"
Sensitive data: Enter the value to be
encrypted in the database.
NOTE: Use quotation
marks around names with spaces. Most values from the Inventory
database can be used.
Click OK.
To define an action variable
Click Tools > Distribution > OS
Deployment.
Right-click a template and click Edit.
Click Action list.
Click Add to create a new action. (If you want
to modify an existing action, right-click the action and select
Properties.)
To add an action variable, click Add.
Type the variable you want to add in the Search
value
box.
Type the value you want to replace in the
Replacement value
box
Select the type.
String: Enter a string value
Database value: Enter a database ID string,
such as Computer.Network."NIC address"
Sensitive data: Enter the value to be
encrypted in the database.
NOTE: Use quotation
marks around names with spaces. Most values from the Inventory
database can be used.