Provisioning template variables

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)

NOTE: Variables are case-sensitive.

To define a device variable 
  1. In the All devices list, right-click a device and select Manage variables.
  2. Type the name of the item (such as IP address) in the Name box.
  3. Type the value to be replaced in the Value box.
  4. Select the type.
  5. NOTE: Use quotation marks around names with spaces. Most values from the Inventory database can be used.

  6. Click Save.
To define a public (global) variable
  1. Click Tools > Distribution > OS Deployment.
  2. On the toolbar, click the Public variables button.
  3. To add a variable, click Add.
  4. Type the variable you want to add in the Search value box (for example, CoreIP).
  5. 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).
  6. Select the type.
  7. NOTE: Use quotation marks around names with spaces. Most values from the Inventory database can be used.

  8. 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
  1. Click Tools > Distribution > OS Deployment.
  2. Under Provisioning templates, click Public or My templates to display a list of templates.
  3. Double-click a template to open the Template view.
  4. Click Template variables.
  5. Click Add.
  6. Type the variable you want to add in the Search value box.
  7. Type the value you want to replace in the Replacement value box.
  8. Select the type. 
  9. NOTE: Use quotation marks around names with spaces. Most values from the Inventory database can be used.

  10. Click OK.
To define an action variable
  1. Click Tools > Distribution > OS Deployment.
  2. Right-click a template and click Edit.
  3. Click Action list.
  4. Click Add to create a new action. (If you want to modify an existing action, right-click the action and select Properties.)
  5. To add an action variable, click Add.
  6. Type the variable you want to add in the Search value box.
  7. Type the value you want to replace in the Replacement value box
  8. Select the type.
  9. NOTE: Use quotation marks around names with spaces. Most values from the Inventory database can be used.

  10. Click OK.