This section describes the Import-MDTTaskSequence Windows PowerShell cmdlet. Run this cmdlet from a Windows PowerShell console that has the MDT PowerShell snap-in loaded. For more information on how to start a Windows PowerShell console that has the MDT PowerShell snap-in loaded, see Loading the MDT Windows PowerShell Snap-In.

Syntax

Import-MDTTaskSequence [-Path <String>] -Template <String> -Name <String> -ID <String> [[-Comments] <String>] [[-Version] <String>] [-OperatingSystemPath <String>] [-OperatingSystem <PSObject>] [-FullName <String>] [-OrgName <String>] [-HomePage <String>] [-ProductKey <String>] [-OverrideProductKey <String>] [-AdminPassword <String>] [<CommonParameters>]

Description

This cmdlet imports a task sequence into a deployment share. The newly imported task sequence will be based on an existing task sequence template specified in the Template property.

Parameters

This subsection provides information about the various parameters that can be used with the Import-MDTPackage cmdlet.

-Path <String>

This parameter specifies the fully qualified path to an existing folder within the deployment share where the task sequence being imported will be placed. By default, the path should point to the Control folder and or a subfolder of the Control folder in the deployment share. The value of the ID parameter will be used to create a subfolder within the path specified in this parameter.

Note   If this parameter is not provided, then the Windows PowerShell working directory must default to the desired location within the deployment share.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-Template <String>

This parameter specifies the task sequence template to be used for importing the new task sequence. Task sequence templates are .xml files that contain the task sequence steps for a particular type of task sequence. If the task sequence template is located in:

·     The installation_folder\Templates folder (where installation_folder is the folder in which MDT is installed), then only the .xml file name is required.

·     Another folder, then the fully qualified path, including the name of the task sequence template .xml, is required.

For more information on the task sequence templates that are included with MDT for LTI deployments, see the section Create a New Task Sequence in the Deployment Workbench in the MDT document, Using the Microsoft Deployment Toolkit.

 

Parameter

Value

Required?

True

Position?

1 and Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-Name <String>

This parameter specifies the name of the task sequence to be imported. The value of this parameter must be unique within the deployment share.

 

Parameter

Value

Required?

True

Position?

2 and Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-ID <String>

This parameter specifies the identifier of the task sequence to be imported. The value of this parameter must be unique within the deployment share. The value assigned to this parameter should be in uppercase and not have any spaces or special characters. This value is used to create a subfolder in the folder specified in the Path parameter, which should be under the Control folder in the deployment share.

 

Parameter

Value

Required?

True

Position?

3 and Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-Comments <String>

This parameter specifies the text that provides additional, descriptive information about the task sequence to be imported. This descriptive information is visible in the Deployment Workbench.

 

Parameter

Value

Required?

False

Position?

4 and Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-Version <String>

This parameter specifies the version number of the task sequence to be imported. The value of this parameter is informational only and is not used by MDT for version-related processing.

 

Parameter

Value

Required?

False

Position?

4 and Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-OperatingSystemPath <String>

This parameter specifies the fully qualified Windows PowerShell path to the folder in the deployment share that contains the operating system to be used with this task sequence, such as DS001:\Operating Systems\Windows 8. The operating system must already exist in the deployment share where the task sequence is being imported.

Note   If you do not provide this parameter and the task sequence needs to reference an operating system, then you must provide the OperatingSystem parameter.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-OperatingSystem <PSObject>

This parameter specifies the operating system object to be used with this task sequence. The operating system must already exist in the deployment share where the task sequence is being imported.

You can retrieve the Windows PowerShell object for an operating system using the Get-Item cmdlet, such as the following example:

$OS=Get-Item "DS001:\Operating Systems\Windows 8"

For more information on the Get-Item cmdlet, see Using the Get-Item Cmdlet.

Note   If you do not provide this parameter and the task sequence needs to reference an operating system, then you must provide the OperatingSystemPath parameter.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-FullName <String>

This parameter specifies the name of the registered owner of the operating system to be used with this task sequence. This name is saved in the RegisteredOwner registry key at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. The value of this parameter is injected into the unattend.xml, unattend.txt, or sysprep.inf files to be associated with this task sequences.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-OrgName <String>

This parameter specifies the name of the organization for the registered owner of the operating system to be used with this task sequence. This name is saved in the RegisteredOrganization registry key at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion. The value of this parameter is injected into the unattend.xml, unattend.txt, or sysprep.inf file to be associated with this task sequences.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-HomePage <String>

This parameter specifies the URL to be used as the home page in Internet Explorer. The value of this parameter is injected into the unattend.xml, unattend.txt, or sysprep.inf files to be associated with this task sequences.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-ProductKey <String>

This parameter specifies the product key to be used for the operating system to be used with this task sequence. This product key is valid only for Windows XP, Windows Server 2003, or retail versions of other Windows operating systems. The value of this parameter is injected into the unattend.xml, unattend.txt, or sysprep.inf file to be associated with this task sequences.

Note   If this parameter is not provided, then the product key must be provided when deploying this task sequence in the Deployment Wizard, in the CustomSettings.ini file, or in the MDT DB.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-OverrideProductKey <String>

This parameter specifies the MAK key to be used for the operating system to be used with this task sequence. This product key is valid only for volume license versions of Windows Vista or later operating systems. The value of this parameter is injected into the unattend.xml, unattend.txt, or sysprep.inf file to be associated with this task sequences.

Note   If this parameter is not provided, then the MAK key must be provided when deploying this task sequence in the Deployment Wizard, in the CustomSettings.ini file, or in the MDT DB.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

-AdminPassword <String>

This parameter specifies the password to be assigned to the built-in, local Administrator account on the target computer. The value of this parameter is injected into the unattend.xml, unattend.txt, or sysprep.inf file to be associated with this task sequences.

Note   If this parameter is not provided, then the password to be assigned to the built-in, local Administrator account on the target computer must be provided when deploying this task sequence in the Deployment Wizard, in the CustomSettings.ini file, or in the MDT DB.

 

Parameter

Value

Required?

False

Position?

Named

Default value

Accept pipeline input?        

False

Accept wildcard characters?

False

 

<CommonParameters>

This cmdlet supports the following common parameters: Verbose, Debug, ErrorAction, ErrorVariable, OutBuffer, OutVariable, WarningAction, and WarningVariable. For more information, see the topic, “about_CommonParameters,” which you can access by typing the following command, and then pressing ENTER:

Get-Help about_CommonParameters

Outputs

This cmdlet outputs a PSObject type object that references the task sequence just imported.

Example 1

Import-MDTTaskSequence -Path "DS001:\Control" –Template "Client.xml" –Name "Deploy Windows 8 to Reference Computer" –ID "WIN8REFERENCE" –Comments "Task sequence for deploying Windows 8 to the reference computer (WDG-REF-01)" –Version "1.00" –OperatingSystemPath "DS001:\Operating Systems\Windows 8_x64" –FullName "Woodgrove Bank Employee" –OrgName "Woodgrove Bank" ‑HomePage "http://www.woodgrovebank.com"  ‑OverrideProductKey "12345‑12345‑12345‑12345‑12345" ‑AdministratorPassword "P@ssw0rd"

Description

This example imports a task sequence named Deploy Windows 8 to Reference Computer and creates the task sequence in the DS001:\Control\WIN8REFERENCE folder in the deployment share. The comment, “Task sequence for deploying Windows 8 to the reference computer (WDG-REF-01),” is assigned to the task sequence. The version number of the task sequence is set to 1.00.

The operating system associated with the task sequence is located at DS001:\Operating Systems\Windows 8_x64 in the deployment share. The registered owner of the operating system will be set to Woodgrove Bank Employee. The registered organization of the operating system will be set to Woodgrove Bank. The Internet Explorer home page will default to http://www.woodgrovebank.com. The password for the local, built-in Administrator account will be set to a value of P@ssw0rd. The product key for the operating system will be set to 12345‑12345‑12345‑12345‑12345.

Example 2

$OSObject=Get-Item "DS001:\Operating Systems\Windows 8_x64"

Import-MDTTaskSequence -Path "DS001:\Control" –Template "Client.xml" –Name "Deploy Windows 8 to Reference Computer" –ID "WIN8REFERENCE" –Comments "Task sequence for deploying Windows 8 to the reference computer (WDG-REF-01)" –Version "1.00"–OperatingSystem $OSObject –FullName "Woodgrove Bank Employee" –OrgName "Woodgrove Bank" ‑HomePage "http://www.woodgrovebank.com"  ‑AdministratorPassword "P@ssw0rd"

Description

This example imports a task sequence named Deploy Windows 8 to Reference Computer and creates the task sequence in the DS001:\Control\WIN8REFERENCE folder in the deployment share. The comment, “Task sequence for deploying Windows 8 to the reference computer (WDG-REF-01),” is assigned to the task sequence. The version number of the task sequence is set to 1.00.

The operating system associated with the task sequence is located at DS001:\Operating Systems\Windows 8_x64 in the deployment share, which is passed to the cmdlet using the $OSObject variable. The $OSObject variable is set to an existing operating system object using the Get-Item cmdlet.

The registered owner of the operating system will be set to Woodgrove Bank Employee. The registered organization of the operating system will be set to Woodgrove Bank. The Internet Explorer home page will default to http://www.woodgrovebank.com. The password for the local, built-in Administrator account will be set to a value of P@ssw0rd. The product key for the operating system will need to be provided when deploying this task sequence in the Deployment Wizard, in the CustomSettings.ini file, or in the MDT DB.

Related Topics

MDT Windows PowerShell Cmdlets