Next Topic

Previous Topic

Book Contents

Variable Manager

Use the Variable Manager to define variables that can be used repeatedly in different scripts. You can maintain multiple values for each managed variable, with each value applied to one or more group IDs. Managed variables cannot be re-assigned new values within a script. Within a script, reference a managed variable by bracketing the variable name with the < and > character. Example: <VariableName>.

Using managed variables, managed machines can run scripts that access locally available resources based on the group ID or subgroup ID.

Note: Using System > Naming Policy, this benefit can be applied automatically by IP address even to a highly mobile workforce that travels routinely between different enterprise locations.

Using Variables

Use variables to store values that can be referenced in multiple script steps. Variables are passed automatically to nested scripts.

  • Variables are created using two methods:
    • Script Variables - Use the Get Variable command within a script to create a new variable name without any special characters. Example: VariableName. In subsequent steps, including steps in nested scripts, reference the variable by bracketing the variable name with the # character. Example: #VariableName#. Scripts variables cannot be referenced outside of the script or nested scripts that use them.
    • Managed Variables - Use the Variable Manager to define variables that can be used repeatedly in different scripts. You can maintain multiple values for each managed variable, with each value applied to one or more group IDs. Managed variables cannot be re-assigned new values within a script. Within a script, reference a managed variable by bracketing the variable name with the < and > character. Example: <VariableName>.
  • Reserved Characters - Because the <, > and # characters are used to identify variable names, these characters must be entered twice as regular text in a command line. For example the following command c:\dir >> filelist.txt is interpreted at script runtime as c:\dir > filelist.txt.
  • Automatic SQL View Data Variables - SQL view parameters are available as automatically declared script variables. Use the format #SqlViewName.ColumnName# or #SqlViewName/ColumnName/Machine.GroupID# in a script to return the value of a dbo.SqlView.Column. If the optional machine ID is omitted, then the value for the agent executing the script is retrieved. Automatic variables enable you to skip using the GetVariable command with the SQL View Data option.
  • GetVariable SQL View Data Command - Use the GetVariable command with the SQL View Data option to create a new script variable and set it to the value of a dbo.SqlView.Column value. Use the format SqlViewName/ColumnName/mach.groupID or SqlViewName/ColumnName. See System > Database Views for a list of the SQL views and columns that are available.

Select Variable

Select a variable name from the drop-down list or select <New Variable> to create a new variable. Variable names are case sensitive.

Rename/Create Variable

Enter a new name for the new variable you are creating or for an existing variable you are renaming.

Public

Selecting the Public radio button allows the variable to be used by all administrators. However, only master administrators can create and edit shared variables.

Private

Selecting the Private radio button allows the variable to be used only by the administrator who created it.

Set Variable Value

Enter the initial value for a variable. Then select one or more Group IDs and click Apply. Empty values are not allowed.

Delete

Select one or more group IDs, then click Delete to remove the variable from the group IDs it is assigned to.

Select All/Unselect All

Click the Select All link to check all rows on the page. Click the Unselect All link to uncheck all rows on the page.

Group ID

Displays all group IDs the logged in user is authorized to administer.

Value

Lists the value of the variable applied to the group ID.