New-CMTaskSequence

New-CMTaskSequence

Creates a task sequence.

Syntax

Parameter Set: NewBuildOSImage
New-CMTaskSequence -BootImagePackageId <String> -BuildOperatingSystemImageOption -JoinDomain <JoinType> {DomainType | WorkgroupType} -OperatingSystemFileAccount <String> -OperatingSystemFilePath <String> -OperatingSystemImageIndex <UInt32> -OperatingSystemImagePackageId <String> -TaskSequenceName <String> [-ApplicationName <String[]> ] [-ApplyAllImages <Boolean> ] [-ClientPackagePackageId <String> ] [-CreatedBy <String> ] [-DomainAccount <String> ] [-DomainName <String> ] [-DomainOrganizationUnit <String> ] [-DomainPassword <SecureString> ] [-GeneratePassword <Boolean> ] [-IgnoreInvalidApplication <Boolean> ] [-ImageDescription <String> ] [-ImageVersion <String> ] [-InstallationLicensingMode <ServerLicensingMode> {NonSpecify | PerSeat | PerServer} ] [-InstallationProductkey <String> ] [-InstallationProperty <String> ] [-LocalAdminPassword <SecureString> ] [-MaximumServerConnection <Int32> ] [-OperatingSystemFileAccountPassword <SecureString> ] [-SoftwareUpdateStyle <SoftwareUpdateStyleType> {All | Mandatory | NoInstall} ] [-SystemPreparationPackageId <String> ] [-TaskSequenceDescription <String> ] [-WorkgroupName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NewCustom
New-CMTaskSequence -CustomOption -TaskSequenceName <String> [-BootImagePackageId <String> ] [-TaskSequenceDescription <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NewInstallOSImage
New-CMTaskSequence -BootImagePackageId <String> -InstallOperatingSystemImageOption -JoinDomain <JoinType> {DomainType | WorkgroupType} -OperatingSystemImageIndex <UInt32> -OperatingSystemImagePackageId <String> -TaskSequenceName <String> [-ApplicationName <String[]> ] [-ApplyAllImages <Boolean> ] [-CaptureLocallyUsingLinks <Boolean> ] [-CaptureNetworkSetting <Boolean> ] [-CaptureUserSetting <Boolean> ] [-CaptureWindowsSetting <Boolean> ] [-ClientPackagePackageId <String> ] [-ConfigureBitLocker <Boolean> ] [-DomainAccount <String> ] [-DomainName <String> ] [-DomainOrganizationUnit <String> ] [-DomainPassword <SecureString> ] [-GeneratePassword <Boolean> ] [-IgnoreInvalidApplication <Boolean> ] [-InstallationLicensingMode <ServerLicensingMode> {NonSpecify | PerSeat | PerServer} ] [-InstallationProductkey <String> ] [-InstallationProperty <String> ] [-LocalAdminPassword <SecureString> ] [-PartitionAndFormatTarget <Boolean> ] [-SaveLocally <Boolean> ] [-SoftwareUpdateStyle <SoftwareUpdateStyleType> {All | Mandatory | NoInstall} ] [-TaskSequenceDescription <String> ] [-UserStateMigrationToolPackageId <String> ] [-WorkgroupName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: NewInstallOSImageVhd
New-CMTaskSequence -BootImagePackageId <String> -InstallOperatingSystemImageVhdOption -JoinDomain <JoinType> {DomainType | WorkgroupType} -OperatingSystemImageIndex <UInt32> -OperatingSystemImagePackageId <String> -TaskSequenceName <String> [-ApplicationName <String[]> ] [-ApplyAllImages <Boolean> ] [-ClientPackagePackageId <String> ] [-ConfigureBitLocker <Boolean> ] [-DomainAccount <String> ] [-DomainName <String> ] [-DomainOrganizationUnit <String> ] [-DomainPassword <SecureString> ] [-GeneratePassword <Boolean> ] [-IgnoreInvalidApplication <Boolean> ] [-InstallationLicensingMode <ServerLicensingMode> {NonSpecify | PerSeat | PerServer} ] [-InstallationProductkey <String> ] [-InstallationProperty <String> ] [-LocalAdminPassword <SecureString> ] [-PartitionAndFormatTarget <Boolean> ] [-TaskSequenceDescription <String> ] [-WorkgroupName <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

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

Parameters

-ApplicationName<String[]>

Specifies an array of names of applications included in the task sequence.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ApplyAllImages<Boolean>

Indicates whether to apply all images.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-BootImagePackageId<String>

Specifies the ID of the boot image package associated with the task sequence.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-BuildOperatingSystemImageOption

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CaptureLocallyUsingLinks<Boolean>

Indicates whether Configuration Manager stores the 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.

Hard-links is a User State Migration Tool (USMT) 4.0 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 the user data after the new operating system is deployed.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CaptureNetworkSetting<Boolean>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CaptureUserSetting<Boolean>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CaptureWindowsSetting<Boolean>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ClientPackagePackageId<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ConfigureBitLocker<Boolean>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CreatedBy<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-CustomOption

Indicates that the cmdlet creates a custom task sequence.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DomainAccount<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DomainName<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DomainOrganizationUnit<String>

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-DomainPassword<SecureString>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-GeneratePassword<Boolean>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-IgnoreInvalidApplication<Boolean>

Indicates whether the task sequence step continues if an individual application installation fails.

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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ImageDescription<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-ImageVersion<String>

Specifies the version of the operating system that the task sequence captures.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InstallationLicensingMode<ServerLicensingMode>

Specifies the Windows Server license mode that the task sequence uses. The acceptable values for this parameter are:

-- NonSpecify
-- PerSeat
-- PerServer

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InstallationProductkey<String>

Specifies the Windows product key.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InstallationProperty<String>

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 ("").

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InstallOperatingSystemImageOption

Indicates that the task sequence installs an existing image option.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-InstallOperatingSystemImageVhdOption

Indicates that the task sequence installs an existing image .vhd option.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-JoinDomain<JoinType>

Specifies the destination computer to add to a workgroup or domain. The acceptable values for this parameter are:

-- DomainType
-- WorkgroupType

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-LocalAdminPassword<SecureString>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-MaximumServerConnection<Int32>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-OperatingSystemFileAccount<String>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-OperatingSystemFileAccountPassword<SecureString>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-OperatingSystemFilePath<String>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-OperatingSystemImageIndex<UInt32>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-OperatingSystemImagePackageId<String>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-PartitionAndFormatTarget<Boolean>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SaveLocally<Boolean>

Indicates whether Configuration Manager clients download the full image to a local cache before the task sequence runs. This parameter has been deprecated.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SoftwareUpdateStyle<SoftwareUpdateStyleType>

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

-- All
-- Mandatory
-- NoInstall

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-SystemPreparationPackageId<String>

Specifies the ID of the Configuration Manager package that contains the appropriate version of Sysprep to use to capture the reference computer settings.

If the operating system version that you are running is Windows Vista or later, Sysprep is automatically installed on the computer and you do not have to specify a package. If the operating system version that you are running is Windows XP SP3 or Windows Server 2003 SP2, you must specify a package that contains the version of Sysprep and its support files that is appropriate for that operating system version. This package does not require a program. Configuration Manager uses the Sysprep files contained in the package.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-TaskSequenceDescription<String>

Specifies a description for the task sequence.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-TaskSequenceName<String>

Specifies a name for the task sequence.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-UserStateMigrationToolPackageId<String>

Specifies the ID of the User State Migration Tool (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.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-WorkgroupName<String>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Create a task sequence that installs the operating system from a boot image

This command creates a task sequence named TaskSeq01 that uses the boot image package that has the ID CM200002.

The command specifies the CustomOption parameter to indicate a custom task sequence.

PS C:\> New-CMTaskSequence -CustomOption -BootImagePackageID "CM200002" -TaskSequenceName "TaskSeq01" -TaskSequenceDescription "Custom task sequence 22" 

Example 2: Create a task sequence that builds the operating system image

This command creates a task sequence named BuildOStask01. The task sequence uses the boot image package that has the ID CM200002 to build an operating system image from a set of operating system installation files in the operating system image package that has the ID CM20000D.

PS C:\> New-CMTaskSequence -BuildOperatingSystemImageOption -BootImagePackageId "CM200002" -TaskSequenceName "BuildOStask01" -OperatingSystemImagePackageId "CM20000D" -OperatingSystemImageIndex "1" -JoinDomain WorkgroupType  -WorkgroupName "Midwest" -OperatingSystemFilePath "\\btc-dist-08\Public\CM\AdminTeam\OpSys01\nodesc_boot.wim" -OperatingSystemFileAccount "Contoso\Primeos" -OperatingSystemFileAccountPassword "Basket11"

Example 3: Create a task sequence that installs the operating system image

This command creates a task sequence that uses the boot image package that has the ID CM200002 to install an operating system image from the operating system image package that has the ID CM20000D.

PS C:\> New-CMTaskSequence -InstallOperatingSystemImageOption -BootImagePackageId "CM200002" -TaskSequenceName "InstallOStask01" -OperatingSystemImagePackageId "CM20000D" -OperatingSystemImageIndex "1" -JoinDomain WorkgroupType  -WorkgroupName "Midwest" -UserStateMigrationToolPackageID "CM200001" -InstallationProductkey "TWB3K-HKMBK-HXRBD-TQGK9-VJRMG"

Enable-CMTaskSequence

Get-CMTaskSequence

Import-CMTaskSequence

Set-CMTaskSequence

Disable-CMTaskSequence

Remove-CMTaskSequence

New-CMTaskSequenceMedia