Hello,
I am using v1.9.0.23355 of TaskScheduler and v1.9.0.23358 of TaskSchedulerEditor. I'm trying to use the TaskEditDialog to modify a task which I have created previously using the following code;
taskFolder.RegisterTaskDefinition(taskName, td);
I pop up the dialog like this;
TaskEditDialog editorForm = new TaskEditDialog(); editorForm.Editable = true; editorForm.RegisterTaskOnAccept = true; editorForm.Initialize(task); editorForm.ShowDialog(); editorForm.BringToFront();
I can modify the task OK, but when I try to change the user who runs the task, say fromMyDomain\UserA to MyDomain\UserB, then I get a COMException with the message "(37,8):LogonType".
I've tried a few permutations of the calls to RegisterTaskDefinition, such as;
taskFolder.RegisterTaskDefinition(taskName, td, TaskCreation.CreateOrUpdate, username, null, TaskLogonType.ServiceAccount, null);
I also tried this;
taskFolder.RegisterTaskDefinition(taskName, td, TaskCreation.CreateOrUpdate, username, null, TaskLogonType.InteractiveToken, null);
This allowed me to change to SYSTEM, but not back to MyDomain\UserA. Same exception again.
I would appreciate any guidance that anyone can give me on how to correctly use the library, and please let me know if there's any other information I can supply which would be useful.