Use this cmdlet to create a task sequence. You typically use a task sequence to deploy an OS to a client, but you can use them for various purposes. For more information, see Manage task sequences to automate tasks.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>. For more information, see getting started.
Examples
Example 1: Create a custom task sequence
This example first splats the cmdlet parameters into the parameters variable. It's not required to splat the parameters, it just makes it easier to read the parameters for such a long command line.
This command creates a blank task sequence with the name Custom.
Example 2: Create a task sequence to install an OS image
This example first splats the cmdlet parameters into the parameters variable. It's not required to splat the parameters, it just makes it easier to read the parameters for such a long command line.
This command creates a task sequence named Install OS image that installs an OS image. It also includes the other parameters that apply to this scenario.
Example 3: Create a task sequence to build and capture an OS
This example first splats the cmdlet parameters into the parameters variable. It's not required to splat the parameters, it just makes it easier to read the parameters for such a long command line.
This example creates a task sequence named Build and capture that builds and captures an OS image using the supplied ___location and account. It also includes the other parameters that apply to this scenario.
Example 4: Create a task sequence to upgrade an OS
This command creates the task sequence named In-place upgrade and specifies that it will upgrade the OS using the upgrade package with the ID XYZ02EBA.
New-CMTaskSequence -UpgradeOperatingSystem -Name "In-place upgrade" -UpgradePackageId "XYZ02EBA" -SoftwareUpdateStyle All
Parameters
-ApplicationName
Specify an array of application names to install during the task sequence. This parameter configures the Install Application task sequence step.
Parameter properties
Type:
String[]
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
UpgradeOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ApplyAll
In the build and capture scenario, the state of this parameter determines the following behaviors:
$true: The task sequence doesn't format & partition the disk before it applies the OS image.
$false: The task sequence includes the Format and Partition Disk steps before it applies the OS image.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
ApplyAllImages
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-BootImagePackageId
Specify the ID of a boot image package to use with a task sequence that deploys an OS. This value is a standard package ID, for example XYZ00005.
This parameter configures the task sequence properties.
When you enable the SaveLocally parameter to save user settings and files locally, set this parameter to $true to capture locally by using links instead of by copying files. The links that Configuration Manager uses to store the user state locally are referred to as hard-links.
The cmdlet ignores this parameter if SaveLocally is $false.
Set this parameter to $true to enable the task sequence to capture network settings. When you enable this option, the task sequence includes the Capture Network Settings step.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-CaptureUserSetting
Set this parameter to $true to enable the task sequence to capture user settings and files. When you enable this option, the task sequence includes the Capture User State step. Also use the UserStateMigrationToolPackageId parameter.
Use SaveLocally and CaptureLocallyUsingLink to configure where the task sequence saves the user state.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-CaptureWindowsSetting
Set this parameter to $true to enable the task sequence to capture Windows settings. When you enable this option, the task sequence includes the Capture Windows Settings step.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ClientPackagePackageId
Specify the ID of the client package to install when the task sequence runs. This value is a standard package ID, for example, XYZ00003. Site assignment and client configuration happen automatically. You can specify extra installation parameters with the InstallationProperty parameter.
Set this parameter to $true to configure the task sequence for use with BitLocker. When you enable this option, the task sequence includes the following steps:
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
cf
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-CreatedBy
For the build and capture scenario, specify an optional string that's on the captured image file for who created it. The maximum length is 255 characters.
This parameter configures the Capture OS Image task sequence step.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-CustomTaskSequence
Add this parameter to create a custom task sequence that contains no steps. For more information, see Create a custom task sequence.
You can then use the 35 New-CMTSStep cmdlets to add steps to the custom task sequence. For more information, see About task sequence steps. Each section describes the task sequence steps, with links to the associated cmdlets.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
CustomOption
Parameter sets
NewCustom
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Description
Specify an optional description for the task sequence. The maximum length is 512 characters. This parameter configures the task sequence properties.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
TaskSequenceDescription
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewCustom
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Parameter properties
Type:
SwitchParameter
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DomainAccount
Specify an account that has the necessary permissions to join the computer to the ___domain. Use the following format: Domain\User. For more information, see ask sequence ___domain join account.
Use the DomainName parameter to specify the ___domain name, and DomainPassword to specify this account's password.
Specify the name of a ___domain to have the computer join when it runs the task sequence. This parameter configures the Apply Network Settings task sequence step.
Use the DomainAccount parameter to specify an account that has permissions to join this ___domain. You can also use the DomainOrganizationUnit parameter to specify an OU in which to create the computer account.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-DomainOrganizationUnit
Specify a ___domain organizational unit (OU) in which to create the computer account in the ___domain. The format of this value is the Lightweight Directory Access Protocol (LDAP) path, for example: LDAP//OU=OSD staging,DC=contoso,DC=com. Specify an OU in the ___domain that you specified in the DomainName parameter.
If an existing computer account is already in an OU, Active Directory doesn't allow you to change the OU and it ignores this setting.
Set this parameter to $true to enable the task sequence option to run as high-performance power plan. This parameter configures the task sequence properties. For more information, see Performance improvements for power plans.
Parameter properties
Type:
Boolean
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-IgnoreInvalidApplication
If you set this parameter to $true, the task sequence continues installing applications in the list if an application installation fails. Use this parameter with the ApplicationName parameter.
For the build and capture scenario, specify an optional string that describes the captured image file. The maximum length is 255 characters.
This parameter configures the Capture OS Image task sequence step.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-ImageVersion
For the build and capture scenario, specify an optional string as the version of the captured image file. You define this value, it doesn't have to be the OS version. The maximum length is 32 characters.
This parameter configures the Capture OS Image task sequence step.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-InstallationLicensingMode
This setting only applies to legacy versions of Windows that are no longer supported. Starting in version 2010, the setting is no longer visible in the task sequence editor. Existing task sequences that still use this setting will continue to function the same.
Parameter properties
Type:
ServerLicensingMode
Default value:
None
Accepted values:
NonSpecify, PerSeat, PerServer
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-InstallationProperty
Specify any extra installation properties to use when the task sequence installs the Configuration Manager client. Site assignment and the default configuration are automatically specified by the task sequence. To enter multiple installation properties, separate them with a space. If a property contains spaces, surround it by quotation marks ("). For more information, see About client installation parameters and properties in Configuration Manager.
Use this parameter to configure the Apply Network Settings task sequence step. The computer needs to either join a workgroup or a ___domain.
DomainType: Join a ___domain. Also specify DomainName, DomainAccount, and DomainPassword. You can also use DomainOrganizationUnit.
WorkgroupType: Join a workgroup. Also specify WorkgroupName. Use this value with the BuildOperatingSystemImage parameter. In the build and capture scenario, the task sequence always joins a workgroup before it captures the image.
Parameter properties
Type:
JoinType
Default value:
None
Accepted values:
DomainType, WorkgroupType
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-LocalAdminPassword
If you don't use the recommended option to GeneratePassword, use this parameter to specify a secure string as the local Administrator password.
This setting only applies to legacy versions of Windows that are no longer supported. Starting in version 2010, the setting is no longer visible in the task sequence editor. Existing task sequences that still use this setting will continue to function the same.
Parameter properties
Type:
Int32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-Name
Specify a name for the task sequence. The maximum length is 50 characters. This parameter configures the task sequence properties.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
TaskSequenceName
Parameter sets
(All)
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OperatingSystemFileAccount
For the build and capture scenario, specify the name of a ___domain account that has permissions to the network share that you specify in the OperatingSystemFilePath parameter. Use OperatingSystemFileAccountPassword to set the account password.
This parameter configures the Capture OS Image task sequence step.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
CaptureOperatingSystemFileAccount
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OperatingSystemFileAccountPassword
For the build and capture scenario, specify a secure string for the password of the OperatingSystemFileAccount.
This parameter configures the Capture OS Image task sequence step.
Parameter properties
Type:
SecureString
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OperatingSystemFilePath
For the build and capture scenario, specify the file path to the network ___location that Configuration Manager uses to store the captured OS image. The path includes the file name with a .wim file extension. Use OperatingSystemFileAccount and OperatingSystemFileAccountPassword to specify an account that has access to this ___location.
This parameter configures the Capture OS Image task sequence step.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Aliases:
CaptureOperatingSystemFilePath
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OperatingSystemImageIndex
Specify the index of the OS image to install for the Apply OS Image task sequence step.
Parameter properties
Type:
UInt32
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-OperatingSystemImagePackageId
Specify the ID of the OS image package to install. Use OperatingSystemImageIndex to specify the image index. This value is a standard package ID, for example XYZ00050.
This parameter configures the Apply OS Image task sequence step.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-PartitionAndFormatTarget
Set this parameter to $true for the task sequence to partition and format the target computer before it installs the OS.
If you enable the CaptureUserSetting parameter, then use this parameter to determine where the task sequence saves the captured user state:
$true: The task sequence configures the local state ___location, and captures locally by using links instead of by copying files. This value configures the Capture User State step.
Use the CaptureLocallyUsingLink parameter to configure the use of hard-links.
$false: The task sequence includes steps to use a state migration point. It configures the following steps:
Specify the ID of the OS upgrade package to use. This value is a standard package ID, for example XYZ00052.
This parameter configures the Upgrade OS task sequence step.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
UpgradeOSImage
Position:
Named
Mandatory:
True
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-UserStateMigrationToolPackageId
When you set CaptureUserSetting to $true, use this parameter to specify the ID of the User State Migration Tool (USMT) package. This value is a standard package ID, for example XYZ00012.
Shows what would happen if the cmdlet runs. The cmdlet doesn't run.
Parameter properties
Type:
SwitchParameter
Default value:
False
Supports wildcards:
False
DontShow:
False
Aliases:
wi
Parameter sets
(All)
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
-WorkgroupName
If you set the JoinDomain parameter to WorkgroupType, use this parameter to specify the workgroup name. This parameter configures the Apply Network Settings task sequence step.
Parameter properties
Type:
String
Default value:
None
Supports wildcards:
False
DontShow:
False
Parameter sets
NewBuildOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
NewInstallOSImage
Position:
Named
Mandatory:
False
Value from pipeline:
False
Value from pipeline by property name:
False
Value from remaining arguments:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
On the Apply Windows Settings task sequence step, this cmdlet sets the User name value to the user that runs the cmdlet, and the Organization name to the computer name where the cmdlet runs.
You can't configure all task sequence and step settings with this cmdlet. To configure other settings, use Set-CMTaskSequence and the Set-CMTSStep cmdlets, for example, Set-CMTSStepApplyOperatingSystem.