When you register a task and specify HighestPrivilege, that setting applies to the running of the task and doesn't have any effect on registration. That right comes from the privileges assigned to the account used to connect to the TaskService. If you have permissions to modify tasks, you should be able to use the code above to enable or disable tasks. Of course to disable a task, you will set the Enabled property to false.
↧