Here's a simple export each TS to an individual zip (you could add -withcontent
and other switches if needed)
import-module C:\sccm\AdminConsole\bin\ConfigurationManager.psd1
CD PRI:
$ts = Get-CMTaskSequence
foreach ($item in $ts)
{
Export-CMTaskSequence -WithContent @True -TaskSequencepackageiD $item.PackageID
-exportfilepath ("C:\temp\" + $item.PackageID + ".zip")
}
Here's a simple import of each .zip to a TS
import-module C:\sccm\AdminConsole\bin\ConfigurationManager.psd1
CD PRI:
$dir = Get-ChildItem "c:\temp\PRI*.zip"
foreach ($file in $dir)
{
Import-CMTaskSequence -ImportFilePath $file
}
From: [email protected] [mailto:[email protected]] On
Behalf Of Marcum, John
Sent: Thursday, May 5, 2016 9:44 AM
To: '[email protected]' <[email protected]>
Subject: [powershell] Migrate MDT Task Sequences
Is it possible to make this export-CMTaskSequence loop through all task
sequences and export each of them to an individual zip file? If so how? And the
next obvious question... How about automating the import too?
________________________________
Confidentiality Notice: This e-mail is from a law firm and may be protected by
the attorney-client or work product privileges. If you have received this
message in error, please notify the sender by replying to this e-mail and then
delete it from your computer.