Benutzer mit den meisten Antworten
SCCM: Export a given SMS Tasksequence with C#

Frage
Antworten
-
Well, you have to first get an instance of the SMS_TaskSequencePackage that contains the required Task Sequence and then execute the method "GetSequence" to get an instance of the SMS_TaskSequence or access the Sequence property (it's a lazy property so we need to have an instance). The problem is, that it only contains the "pure" xml of the TaskSequence itself. You have to programmatically add a bit more beef to have a valid xml file that you can use to import again (BootImage, etc.). See http://trevorsullivan.net/2010/05/13/exporting-configmgr-task-sequences/ for a simple powershell example on how to get the Sequence itself.
Regards
Maik
http://myitforum.com/cs2/blogs/maikkoster/- Als Antwort markiert Andrei TalmaciuModerator Donnerstag, 3. März 2011 15:26
Alle Antworten
-
Hilft das?
"How to Enumerate the Steps in an Operating System Deployment Task Sequence": http://msdn.microsoft.com/en-us/library/cc144243.aspx
"How to Read a Task Sequence from a Task Sequence Package": http://msdn.microsoft.com/en-us/library/cc145147.aspx -
I want to export the complete TaskSequence information. With "Confiuration Manager Console" I can export a XML file containg the complete information of the TaskSequence. This step I want to automate using C#.
I have found out, that WMI Class SMS_Tasksequence hat a Method ExportXm. But i have found no ways to create an instance of the Class.
Thanks again.
-
Well, you have to first get an instance of the SMS_TaskSequencePackage that contains the required Task Sequence and then execute the method "GetSequence" to get an instance of the SMS_TaskSequence or access the Sequence property (it's a lazy property so we need to have an instance). The problem is, that it only contains the "pure" xml of the TaskSequence itself. You have to programmatically add a bit more beef to have a valid xml file that you can use to import again (BootImage, etc.). See http://trevorsullivan.net/2010/05/13/exporting-configmgr-task-sequences/ for a simple powershell example on how to get the Sequence itself.
Regards
Maik
http://myitforum.com/cs2/blogs/maikkoster/- Als Antwort markiert Andrei TalmaciuModerator Donnerstag, 3. März 2011 15:26