Task sequence built-in variables are provided by System Center 2012 Configuration Manager. Built-in variables provide information about the environment where the task sequence is running, and their values are available throughout the whole task sequence. Typically, built-in variables are initialized before steps are run in the task sequence. For example, the built-in variable _SMSTSLogPath is an environment variable that specifies the path that Configuration Manager components use to write log files while the task sequence runs; any task sequence step can access this environment variable. However, some variables, such as _SMSTSCurrentActionName, are evaluated before each step. The values of built-in variables are generally read-only. The values are read only for built-in variables with a name that begins with an underscore.

Task Sequence Built-in Variable List

The following list describes the built-in variables that are available in Configuration Manager:

Built-in Variable Name Description

_SMSTSAdvertID

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

Example:

ABC20001

_SMSTSBootImageID

Stores the Configuration Manager 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 boot image package is associated.

Example:

ABC00001

_SMSTSBootUEFI

For Configuration Manager SP1 only:

The task sequence sets the SMSTSBootUEFI variable when it detects a computer that is in UEFI mode.

_SMSTSClientGUID

Stores the value of Configuration Manager 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 is 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 must 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 that was returned by the last action that was run. This variable can be used as a condition to determine if the next step is 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 started by using the Configuration Manager client.

  • UFD - specifies that the task sequence is started by using USB media and that the USB media was created in Windows XP/2003.

  • UFD+FORMAT - specifies that the task sequence is started by using USB media and that the USB media was created in Windows Vista or later.

  • CD - specifies that the task sequence is started by using a CD.

  • DVD - specifies that the task sequence is started by using a DVD.

  • PXE - specifies that the task sequence is started from PXE.

  • HD – specifies that the task sequence was started from a hard disk (prestaged media only).

_SMSTSLogPath

Stores the full path of the log directory. This can be used to determine where actions are logged. This value is not set when a hard drive is not 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

_SMSTSMDataPath

Specifies the path defined by the SMSTSLocalDataDrive variable. When you define SMSTSLocalDataDrive before the task sequence starts, such as by setting a collection variable, Configuration Manager then defines the _SMSTSMDataPath variable once the Task Sequence starts.

_SMSTSMediaType

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

_SMSTSMP

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

_SMSTSMPPort

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

Example:

80

_SMSTSOrgName

Stores the branding title name that is displayed in a task sequence progress user interface dialog box.

Example:

XYZ Organization

_SMSTSPackageID

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

Example:

HJT00001

_SMSTSPackageName

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

Example:

Deploy Windows 7 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 obtains required package shares from distribution point.

_SMSTSSiteCode

Stores the site code of the Configuration Manager 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.

_SMSTSTimezone

The _SMSTSTimezone variable stores the time zone information in the following format (without spaces):

Bias, StandardBias, DaylightBias, StandardDate.wYear, wMonth, wDayOfWeek, wDay, wHour, wMinute, wSecond, wMilliseconds, DaylightDate.wYear, wMonth, wDayOfWeek, wDay, wHour, wMinute, wSecond, wMilliseconds, StandardName, DaylightName

Example:

For the Eastern Time U.S. and Canada, the value would be 300,0,-60,0,11,0,1,2,0,0,0,0,3,0,2,2,0,0,0,Eastern Standard Time,Eastern Daylight Time

_SMSTSUseCRL

Specifies whether the task sequence uses the certificate revocation list when it uses a Secure Socket Layer (SSL) certificate to communicate with the management point.

_SMSTSUserStarted

Specifies whether a task sequence is started by a user. This variable is set only if the task sequence is started from the Software Center. 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 Software Center.

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

_SMSTSUseSSL

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

_SMSTSWTG

For Configuration Manager SP1 only:

Specifies if the computer is running as a Windows To Go device.

SMSTSAssignmentsDownloadInterval

For Configuration Manager SP1 only:

Use this variable to specify the number of seconds to wait before the client will attempt to download the task sequence policy since the last attempt (which returned no policies).

You can set this variable by using a prestart command from media or PXE.

SMSTSAssignmentsDownloadRetry

For Configuration Manager SP1 only:

Use this variable to specify the number of times a client will attempt to download the task sequence policy after no policies are found on the first attempt.

You can set this variable by using a prestart command from media or PXE.

SMSTSAssignUsersMode

Specifies how a task sequence associates users with the destination computer. Set the variable to one of the following values.

  • Auto: The task sequence creates a relationship between the specified users and destination computer when it deploys the operating system to the destination computer.

  • Pending: The task sequence creates a relationship between the specified users and the destination computer, but waits for approval from the administrative user before the relationship is set.

  • Disabled: The task sequence does not associate users with the destination computer when it deploys the operating system.

SMSTSDownloadProgram

For Configuration Manager SP1 only:

Use this variable to specify an Alternate Content Provider, a downloader program that is used to download content instead of the default Configuration Manager downloader, for the task sequence. As part of the content download process, the task sequence checks the variable for a specified downloader program. If specified, the task sequence runs the program to perform the download.

SMSTSErrorDialogTimeout

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

SMSTSLanguageFolder

For Configuration Manager SP1 only:

Use this variable to change the display language of a language neutral boot image.

SMSTSLocalDataDrive

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

This variable must be set before the task sequence starts, such as by setting a collection variable. Once the task sequence starts, Configuration Manager defines the _SMSTSMDataPath variable once the Task Sequence starts.

SMSTSPersistContent

For Configuration Manager SP1 only:

Use this variable to temporarily persist content in the task sequence cache.

SMSTSPostAction

For Configuration Manager SP1 only:

Specifies a command that is run after the task sequence completes. For example, you can use this variable to specify a script that enables write filters on embedded devices after the task sequence deploys an operating system to the device.

SMSTSPreferredAdvertID

Forces a specific targeted deployment on the destination computer to be run. This can be set through a prestart command from media or PXE. If this variable is set, the task sequence overrides any required deployments.

OSDPreserveDriveLetter

For Configuration Manager SP1 only:

This variable determines whether or not the task sequence uses the drive letter captured in the operating system image WIM file when applying that image to a destination computer. In Configuration Manager with no service pack, the drive letter captured in the WIM file was used when applying the operating system image WIM file. In Configuration Manager SP1, you can set the value for this variable to False to use the drive letter that you specify in the task sequence.

SMSTSRebootDelay

Specifies how many seconds to wait before the computer restarts. 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 restart is requested. If this variable is not set, a default message will appear.

Example:

This computer is being restarted by the task sequence manager.

SMSTSRebootRequested

Indicates that a restart is requested after the current task sequence step is completed. If a restart is required, just set this variable to true, and the task sequence manager will restart the computer after this task sequence step. The task sequence step must set this task sequence variable if it requires the restart to complete the task sequence step. After the computer is restarted, the task sequence will continue to run from the next task sequence step.

SMSTSRetryRequested

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

SMSTSUDAUsers

Specifies the primary user of the destination computer. Specify the users by using the following format. Separate multiple users by using a comma (,).

Example:

domain\user1, domain\user2, domain\user3

For more information about associating users with the destination computer, see How to Associate Users with a Destination Computer.

See Also