Operating System Deployment Task Sequence Variables

Updated: April 1, 2009

The following sections describe task sequence action variables (action variables) and task sequence built-in variables (built-in variables). The following lists display Configuration Manager 2007 task sequence variables and how you can use them to control and customize a task sequence. Task sequence variables supply configuration settings for computer, operating system, and user state configuration tasks that are performed on a Configuration Manager 2007 computer. Task sequence variables provide a mechanism to configure and customize individual task sequence steps within a task sequence. For more information about task sequence variables, see About Task Sequence Variables.

When a computer runs a task sequence, the task sequence environment is initialized using general configuration settings. As individual task sequence steps are run within the task sequence, settings specific to the current task sequence action are added to the task sequence environment. After each task sequence step is completed, any settings specific to the task sequence step are removed from the task sequence environment.

Using action variables, you can change the associated default values of a task sequence to customize how the task sequence step will be run on a target computer.

noteNote
Task sequence variables with names that begin with an underscore (_) character are read-only. You can access the values associated with read-only task sequence variables; however, you cannot change the associated values.

Task Sequence Action Variables

Task sequence action variables (action variables) specify configuration properties for a particular task sequence step. By default, the task sequence step settings are initialized and available only when the associated task sequence step is run. In other words, the task sequence variable setting is added to the task sequence environment before the task sequence step is run, and the value is removed after the task sequence step has run.

For example: Using the task sequence editor, you can specify a start-in directory for a command line action by specifying the Start In property value in the Run Command Line task sequence step. The default value specified is stored in the task sequence environment as the WorkingDirectory variable, which is specific to the Run Command Line task sequence action. The WorkingDirectory environment variable is initialized before running the Run Command Line task sequence action. During the Run Command Line step, the specified directory value can be accessed through the environment variable named WorkingDirectory. After the task sequence step completes, the variable is removed from the task sequence environment. If the sequence contains another Run Command Line task sequence step, the new WorkingDirectory variable is initialized and set to the starting value for that task sequence.

While the default value for a task sequence action setting is present while the task sequence step is run, any new value you set can be used by multiple steps in the sequence. If you use one of the task sequence variable creation methods to override a built-in variable value, the new value remains in the environment and overrides the default value for other steps in the task sequence. In the previous example, if a Set Task Sequence Variable step is added as the first step of the task sequence and sets the WorkingDirectory environment variable to the value C:\, both Run Command Line steps in the task sequence will use the new starting directory value.

Configuration Manager 2007 task sequence variables are grouped by their associated task sequence action:

Task Sequence Built-in Variables

Task sequence built-in variables (built-in variables) are produced by the underlying task sequence engine, and their associated values are generally read-only. Built-in variables provide information about the environment where the associated task sequence is running. The values associated with a built-in variable are available in the task sequence environment throughout the entire task sequence. Typically, built-in variables are initialized before any task sequence steps are run in the task sequence. For example, the built-in variable _SMSTSLogPath specifies the path that Configuration Manager 2007 components use to write log files while the task sequence runs; any task sequence step can access this environment variable.

The following list describes the Configuration Manager 2007 built-in variables available for use within a Configuration Manager 2007 task sequence:

 

Built-in Variable Name Description

_SMSTSAdvertID

Stores the current running task sequence advertisement ID. It uses the same format as a Configuration Manager 2007 software distribution advertisement ID. If the task sequence is running from stand-alone media, this variable is undefined.

Example:

"ABC20001"

_SMSTSBootImageID

Stores the Configuration Manager 2007 boot image package ID if a boot image package is associated with the current running task sequence. The variable will not be set if no Configuration Manager 2007 boot image package is associated.

Example:

"ABC00001"

_SMSTSClientGUID

Stores the value of Configuration Manager 2007 client GUID. This variable is not set if the task sequence is running from stand-alone media.

Example:

"0a1a9a4b-fc56-44f6-b7cd-c3f8ee37c04c"

_SMSTSCurrentActionName

Specifies the name of the currently running task sequence step. This variable will be set before the task sequence manager runs each individual step.

Example:

"run command line"

_SMSTSDownloadOnDemand

Set to "true" if the current task sequence is running in download-on-demand mode, which means the task sequence manager downloads content locally only when it needs to access the content.

_SMSTSInWinPE

This variable is set to "true" when the current task sequence step is running in the Windows PE environment, and it is set to "false" if not. You can test this task sequence variable to determine the current operating system environment.

_SMSTSLastActionRetCode

Stores the return code returned by the last action that was run.

Example:

"0"

_SMSTSLastActionSucceeded

The variable is set to "true" if the last action succeeded and to "false" if the last action failed. If the last action was skipped because the step was disabled or the associated condition evaluated to false, this variable is not reset, which means it still holds the value for the previous action.

_SMSTSLaunchMode

Specifies the task sequence launch method. The task sequence can have the following values:

  • "SMS" - specifies that the task sequence is launched using the Configuration Manager 2007 client.

  • "UFD" - specifies that the task sequence is launched using USB media.

  • "CD" - specifies that the task sequence is launched using CD/DVD sets.

  • "PXE" - specifies that the task sequence is launched from PXE.

_SMSTSLogPath

Stores the full path to the log directory. This can be used to determine where actions should be logged. This value is not set when no hard drive is available.

_SMSTSMachineName

Stores and specifies the computer name. Stores the name of the computer that the task sequence will use to log all status messages. To change the computer name in the new operating system, use the OSDComputerName variable.

Example:

"ABC"

_SMSTSMediaType

Specifies the type of media that will be used to initiate the installation. Examples of types of media are Boot Media, Full Media, and PXE.

_SMSTSMP

Stores the name or IP address of a Configuration Manager 2007 management point.

_SMSTSMPPort

Stores the management point port number of a Configuration Manager 2007 management point.

Example:

"80"

_SMSTSOrgName

Stores the branding title name, which will be displayed in a task sequence progress UI dialog.

Example:

"XYZ Organization"

_SMSTSPackageID

Stores the current running task sequence ID. This ID uses the same format as a Configuration Manager 2007 software package ID.

Example:

"HJT00001"

_SMSTSPackageName

Stores the current running task sequence name specified by the Configuration Manager 2007 administrator when the task sequence is created.

Example:

"Deploy xpsp2 task sequence"

_SMSTSRunFromDP

Set to "true" if the current task sequence is running in run-from-distribution-point mode, which means the task sequence manager will obtain required packages from distribution point shares.

_SMSTSSiteCode

Stores the site code of the Configuration Manager 2007 site.

Example:

"ABC"

_SMSTSType

Specifies the type of the current running task sequence. It can have the following values:

"1" - indicates a generic task sequence.

"2" - indicates an operating system deployment task sequence.

_SMSTSUseCRL

Specifies whether the task sequence uses the certificate revocation list when using SSL to communicate with the management point.

_SMSTSUserStarted

Specifies whether a task sequence is started by a user. This variable will only be set if the task sequence is started from the Configuration Manager 2007 client. For example, if _SMSTSLaunchMode is set to "SMS". The variable can have the following values:

  • "true" - specifies that the task sequence is manually started by a user from the client Run Advertised Programs applet.

  • "false" - specifies that the task sequence is initiated automatically by the Configuration Manager 2007 scheduler.

_SMSTSUseSSL

Specifies whether the task sequence uses SSL to communicate with the Configuration Manager 2007 management point. If your site is running in native mode, the value is set to "true".

SMSTSErrorDialogTimeout

When an error occurs in a task sequence, a dialog is displayed that is dismissed automatically after a default timeout value. Use this variable to specify a timeout value in seconds other than the default of 15 minutes.

SMSTSRebootDelay

Specifies how many seconds to wait before the computer will reboot. The task sequence manager will display a notification dialog before reboot if this variable is not set to 0.

Examples:

"0"

"30"

SMSTSRebootMessage

Specifies the message to display in the shutdown dialog box when a reboot is requested. If this variable is not set, then a default message will be shown.

Example:

This computer is being rebooted by the task sequence manager.

SMSTSRebootRequested

Indicates that a reboot is requested after completing the current task sequence step. If a reboot is needed, simply set this variable to "true" and the task sequence manager will restart the machine after this task sequence step. The task sequence does not support an individual task sequence step to reboot the computer. The task sequence step must set this task sequence variable if it requires a reboot to complete the task sequence step. After the computer is rebooted, the task sequence will continue running from the next task sequence step.

SMSTSLocalDataDrive

Specifies where temporary files are stored on the target computer while the task sequence is running.

SMSTSRetryRequested

Requests a retry after the completion of the current task sequence step. If this task sequence variable is set, the SMSTSRebootRequested must also be set to "true". After the computer is rebooted, the task sequence manager will rerun the same task sequence step.

See Also

Did you find this information useful? Please click the following link to send your suggestions and comments about the documentation to the Configuration Manager Doc Feedback alias: SMSdocs@microsoft.com.
Page view tracker