Quantcast
Channel: Task Scheduler Managed Wrapper
Viewing all articles
Browse latest Browse all 2206

New Post: Deserialize Task Xml

$
0
0
First you must have XML in the right format. This can be done via the library by capturing the output from an existing task via the Task.Xml property or by calling the task's Export method. If the task doesn't already exist, build up the TaskDefinition as outlined in the documentation and then capture the TaskDefinition instance's XmlText property. Note that all these suggestions return Xml using the schema defined by Microsoft for tasks.

Once you have the properly formatted Xml, you can create tasks by:
  1. Call the TaskService instance's NewTaskFromFile method passing the file path and then registering the returned TaskDefintion.
  2. Get an instance to the TaskFolder in which you want to create the task and call its RegisterTask method passing in the xml (not the file) as the second parameter.
  3. Get an instance to the TaskFolder in which you want to create the task and call its ImportTask method passing in the xml file path as the second parameter.

Viewing all articles
Browse latest Browse all 2206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>