Issues Creating Task Triggers #942
-
Hi, Would anyone be able to point me in the right directions with this. If I try to create anything other than a TimeTrigger (i.e. DailyTrigger), when the task is registered I get a warning in my Task Scheduler logging as follows: "Task registered task "\MyTask" but not all specified triggers will start the task. User Action: Ensure that all the task triggers are valid as configured. Additional Data: Error Value: 2147942487." I've been going through everything with a fine tooth comb, but I can't find the reason. I initially thought that it was because I was creating my trigger in a separate method, however splitting it out, in-line yields the same results. For reference, here is my trigger function:
and it's been set to the task definition using the following switch statement (which again, I removed and didn't check for the trigger type and still ended up with the same result):
Any pointers would be gratefully appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
UPDATE: I've been working through the issue today and it seems to be not related to the trigger at all, instead it is happening when I try to set the user that the task is going to run as. The first call works and creates the task successfully: However, this is what I was using and is causing the failure: Currently investigating other ways to do this to see if I can get round it or not |
Beta Was this translation helpful? Give feedback.
-
You cannot supply a username or password when using |
Beta Was this translation helpful? Give feedback.
You cannot supply a username or password when using
TaskLogonType.InteractiveTokenOrPassword
if the task was first registered usingTaskLogonType.InteractiveToken
which is the default when callingts.RootFolder.RegisterTaskDefinition(taskScheduler.TaskName, td);
. -- Microsoft limitation. I'd try using the full parameter overload forRegisterTaskDefinition
the first time like you have tried to do subsequently.