New-CMTaskSequence

Creates a task sequence.

Syntax

New-CMTaskSequence
   [-BuildOperatingSystemImage]
   -Name <String>
   [-Description <String>]
   -BootImagePackageId <String>
   -OperatingSystemImagePackageId <String>
   -OperatingSystemImageIndex <UInt32>
   [-ApplyAll <Boolean>]
   [-ProductKey <String>]
   [-InstallationLicensingMode <ServerLicensingMode>]
   [-MaximumServerConnection <Int32>]
   [-GeneratePassword <Boolean>]
   [-LocalAdminPassword <SecureString>]
   [-TimeZone <TimeZoneInfo>]
   -JoinDomain <JoinType>
   [-WorkgroupName <String>]
   [-DomainName <String>]
   [-DomainOrganizationUnit <String>]
   [-DomainAccount <String>]
   [-DomainPassword <SecureString>]
   [-ClientPackagePackageId <String>]
   [-InstallationProperty <String>]
   [-SoftwareUpdateStyle <SoftwareUpdateStyleType>]
   [-ApplicationName <String[]>]
   [-IgnoreInvalidApplication <Boolean>]
   [-CreatedBy <String>]
   [-ImageVersion <String>]
   [-ImageDescription <String>]
   -OperatingSystemFilePath <String>
   -OperatingSystemFileAccount <String>
   [-OperatingSystemFileAccountPassword <SecureString>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMTaskSequence
   [-InstallOperatingSystemImage]
   -Name <String>
   [-Description <String>]
   -BootImagePackageId <String>
   -OperatingSystemImagePackageId <String>
   -OperatingSystemImageIndex <UInt32>
   [-ApplyAll <Boolean>]
   [-PartitionAndFormatTarget <Boolean>]
   [-ConfigureBitLocker <Boolean>]
   [-ProductKey <String>]
   [-InstallationLicensingMode <ServerLicensingMode>]
   [-GeneratePassword <Boolean>]
   [-LocalAdminPassword <SecureString>]
   [-TimeZone <TimeZoneInfo>]
   -JoinDomain <JoinType>
   [-WorkgroupName <String>]
   [-DomainName <String>]
   [-DomainOrganizationUnit <String>]
   [-DomainAccount <String>]
   [-DomainPassword <SecureString>]
   [-ClientPackagePackageId <String>]
   [-InstallationProperty <String>]
   [-CaptureUserSetting <Boolean>]
   [-UserStateMigrationToolPackageId <String>]
   [-SaveLocally <Boolean>]
   [-CaptureLocallyUsingLink <Boolean>]
   [-CaptureNetworkSetting <Boolean>]
   [-CaptureWindowsSetting <Boolean>]
   [-SoftwareUpdateStyle <SoftwareUpdateStyleType>]
   [-ApplicationName <String[]>]
   [-IgnoreInvalidApplication <Boolean>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMTaskSequence
   [-InstallOperatingSystemImageVhd]
   -Name <String>
   [-Description <String>]
   -BootImagePackageId <String>
   -OperatingSystemImagePackageId <String>
   -OperatingSystemImageIndex <UInt32>
   [-ApplyAll <Boolean>]
   [-PartitionAndFormatTarget <Boolean>]
   [-ConfigureBitLocker <Boolean>]
   [-ProductKey <String>]
   [-InstallationLicensingMode <ServerLicensingMode>]
   [-GeneratePassword <Boolean>]
   [-LocalAdminPassword <SecureString>]
   [-TimeZone <TimeZoneInfo>]
   -JoinDomain <JoinType>
   [-WorkgroupName <String>]
   [-DomainName <String>]
   [-DomainOrganizationUnit <String>]
   [-DomainAccount <String>]
   [-DomainPassword <SecureString>]
   [-ClientPackagePackageId <String>]
   [-InstallationProperty <String>]
   [-ApplicationName <String[]>]
   [-IgnoreInvalidApplication <Boolean>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMTaskSequence
   [-UpgradeOperatingSystem]
   -Name <String>
   -UpgradePackageId <String>
   [-ProductKey <String>]
   [-SoftwareUpdateStyle <SoftwareUpdateStyleType>]
   [-ApplicationName <String[]>]
   [-IgnoreInvalidApplication <Boolean>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMTaskSequence
   [-CustomTaskSequence]
   -Name <String>
   [-Description <String>]
   [-BootImagePackageId <String>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-CMTaskSequence cmdlet creates a task sequence. A task sequence performs multiple steps or tasks on a Microsoft System Center Configuration Manager client computer without user intervention.

Examples

Example 1: Create a custom task sequence

PS C:\> New-CMTaskSequence -CustomTaskSequence -Name "TaskSequence01"

This command creates a task sequence with the name TaskSequence01.

Example 2: Create a task sequence to install an operating system image

PS C:\> New-CMTaskSequence -InstallOperatingSystemImage -Name "TaskSequence02" -BootImagePackageId SC100002 -OperatingSystemImagePackageId SC10000D -OperatingSystemImageIndex 1 -JoinDomain WorkgroupType -WorkgroupName "WorkGroup01" -ApplyAll $True -Description "Task sequence description"

This command creates a task sequence named TaskSequence02 that installs an operating system image and joins a workgroup.

Example 3: Create a task sequence to build an operating system and join a workgroup

PS C:\> New-CMTaskSequence -BuildOperatingSystemImage -Name "TaskSequence03" -BootImagePackageId SC100002 -OperatingSystemImagePackageId SC10000D -OperatingSystemImageIndex 1 -JoinDomain WorkgroupType -WorkgroupName "WorkGroup01" -OperatingSystemFilePath "\\Server1\image\OSImage.wim" -OperatingSystemFileAccount "domain\account"

This command creates a task sequence named TaskSequence03 that builds an operating system using the supplied location and account, and joins a workgroup.

Example 4: Create a task sequence to install an operating system to a virtual hard disk

PS C:\> New-CMTaskSequence -InstallOperatingSystemImageVhd -Name "TaskSequence04" -BootImagePackageId SC100002 -OperatingSystemImagePackageId SC10000D -OperatingSystemImageIndex 1 -JoinDomain WorkgroupType -WorkgroupName "WorkGroup01"

This command creates a task sequence named TaskSequence04 that installs an operating system to a vhd and joins a workgroup.

Example 5: Create a task sequence to upgrade an operating system

PS C:\> New-CMTaskSequence -UpgradeOperatingSystem -Name "TaskSequence05" -UpgradePackageId SC102EBA

This command creates the task sequence named TaskSequence05 and specifies that the task sequence will upgrade the operating system using the upgrade package with the ID SC102EBA.

Required Parameters

-BootImagePackageId

Specifies the ID of a boot image package.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-BuildOperatingSystemImage

Indicates that the task sequence builds and captures a reference operating system image from a set of operating system installation files.

Type:SwitchParameter
Aliases:BuildOperatingSystemImageOption
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CustomTaskSequence

Indicates that the cmdlet creates a custom task sequence.

Type:SwitchParameter
Aliases:CustomOption
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InstallOperatingSystemImage

Indicates that the task sequence installs an operating system image.

Type:SwitchParameter
Aliases:InstallOperatingSystemImageOption
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InstallOperatingSystemImageVhd

Indicates that the task sequence installs an existing operating system image to a virtual hard disk.

Type:SwitchParameter
Aliases:InstallOperatingSystemImageVhdOption
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JoinDomain

Specifies the destination computer to add to a workgroup or domain. Valid values are:

  • DomainType
  • WorkgroupType
Type:JoinType
Parameter Sets:DomainType, WorkgroupType
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies a name for the task sequence.

Type:String
Aliases:TaskSequenceName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemFileAccount

Specifies the Windows account that has permissions to the network share that you specify in the OperatingSystemFilePath parameter.

Type:String
Aliases:CaptureOperatingSystemFileAccount
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemFilePath

Specifies the file system path to the location that Configuration Manager uses when it stores the captured operating system image.

Type:String
Aliases:CaptureOperatingSystemFilePath
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemImageIndex

Specifies the index of the operating system image to install. Use this parameter if the operating system image package has multiple images.

Type:UInt32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemImagePackageId

Specifies the ID of the package that contains the operating system image to install.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UpgradeOperatingSystem

Indicates that the task sequence upgrades the operating system from an upgrade package.

Type:SwitchParameter
Aliases:UpgradeOperatingSystemOption
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UpgradePackageId

Specifies the ID for an upgrade package.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-ApplicationName

Specifies an array of names for applications.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ApplyAll

Indicates whether to apply all of the images.

Type:Boolean
Aliases:ApplyAllImages
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CaptureLocallyUsingLink

Indicates whether Configuration Manager stores captured data locally on the destination computer.

The links that Configuration Manager uses to store the user state locally are referred to as hard-links. Added in User State Migration Tool (USMT) 4.0, hard-links is a USMT feature that scans the computer for user files and settings and then creates a directory of hard-links to those files. The hard-links are then used to restore user data after the new operating system is deployed.

Type:Boolean
Aliases:CaptureLocallyUsingLinks
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CaptureNetworkSetting

Indicates whether the task sequence captures network settings from the computer that runs the task sequence.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CaptureUserSetting

Indicates whether the task sequence captures the user state. If you specify this parameter, also specify the UserStateMigrationToolPackageId parameter.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CaptureWindowsSetting

Indicates whether the task sequence captures Windows settings from the computer that runs the task sequence. You can capture the computer name, registered user and organization name, and the time zone settings.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ClientPackagePackageId

Specifies the ID of the client package to install on the destination computer.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ConfigureBitLocker

Indicates whether the task sequence enables BitLocker encryption on the hard drive.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-CreatedBy

Specifies the name of the user that created the operating system image that the task sequence captures.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies a description for the task sequence.

Type:String
Aliases:TaskSequenceDescription
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DomainAccount

Specifies an account, in the format Domain\User, that has the necessary permissions to join the computer to the domain.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DomainName

Specifies a domain name. Include this parameter to have the target computer join the specified domain.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DomainOrganizationUnit

Specifies the Lightweight Directory Access Protocol (LDAP) path for an organizational unit (OU) for the computer to join. Use the following format: LDAP//OU=computers, DC=Contoso.com, C=com. Specify an OU in the domain that you specified in the DomainName parameter.

If the computer is already a member of some other OU, Active Directory Domain Services (AD DS) does not allow you to change the OU and this setting is ignored.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DomainPassword

Specifies, as a secure string, the password for the user account that you specified for the DomainAccount parameter.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ForceWildcardHandling

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-GeneratePassword

Indicates whether Configuration Manager randomly generates a password for the local administrator account in the new operating system.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IgnoreInvalidApplication

Indicates whether the task sequence step continues if an individual application installation encounters a recoverable failure.

If you specify this parameter, the task sequence continues regardless of any installation errors. If you do not specify this parameter, the task sequence step ends immediately when an installation fails.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ImageDescription

Specifies a description of the operating system image that the task sequence captures.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ImageVersion

Specifies the user-defined version of the operating system that the task sequence captures.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InstallationLicensingMode

Specifies the Windows Server license mode that the task sequence uses. Valid values are:

  • NonSpecify
  • PerSeat
  • PerServer
Type:ServerLicensingMode
Parameter Sets:NonSpecify, PerSeat, PerServer
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InstallationProperty

Specifies Configuration Manager client installation properties.

Site assignment and the default configuration are automatically specified by the task sequence action. You can use this parameter to specify any additional installation properties to use when you install the client. To enter multiple installation properties, separate them with a space. If a property contains spaces, surround it by quotation marks ("").

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LocalAdminPassword

Specifies, as a secure string, the local administrator password for the destination computer.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaximumServerConnection

Specifies the maximum number of server connections. Specify this parameter if you use the PerServer value for the InstallationLicensingMode parameter.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OperatingSystemFileAccountPassword

Specifies as a secure string the password for the account that you specify in the OperatingSystemFileAccount parameter.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartitionAndFormatTarget

Indicates whether the task sequence partitions and formats the destination computer before the operating system is installed.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ProductKey

Specifies the Windows product key for the operating system installation.

Type:String
Aliases:InstallationProductKey
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SaveLocally

This parameter has been deprecated.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SoftwareUpdateStyle

Specifies whether the task sequence installs all updates or only mandatory updates for the destination computers that receive the task sequence. Valid values are:

  • All
  • Mandatory
  • NoInstall
Type:SoftwareUpdateStyleType
Parameter Sets:All, Mandatory, NoInstall
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TimeZone
Type:TimeZoneInfo
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UserStateMigrationToolPackageId

Specifies the ID of the USMT package.

To store the user state data locally or on a state migration point, you must create a package that contains the USMT source files that you want to use.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-WorkgroupName

Specifies the name of a workgroup. Specify this parameter if you use the WorkgroupType value for the JoinDomain parameter.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False