0

On a Windows Server 2016 machine, I want to configure Task Scheduler to run an action based on an event. But I cannot get it to work.

Here is how I can easily reproduce it:

  1. If not done yet, click on Enable All Tasks History at the Actions pane on the right
  2. Click on Create Task...
  3. Enter "Trigger Test" in the Name field
  4. Go to the Triggers tab, click New
  5. For Begin the task:, select On an event; as Log select System; click OK
  6. Go to the Actions tab, click New
  7. In Program/script, enter "C:\Windows\notepad.exe"; click OK
  8. Click OK to finally create the task

Now go to the History tab of the "Trigger Test" task. Besides the Information, that the "Trigger Test" task is registered, there is a warning with Event ID 113, saying:

Task registered task "\Trigger Test" , but not all specified triggers will start the task. User Action: Ensure all the task triggers are valid as configured. Additional Data: Error Value: 2147946601.

The history entries may only be available a few seconds after the task is created, press F5 to refresh in that case.

So I cannot get my task to work. Of course, I want to register for specific events and instead of "notepad.exe", I want to run a PowerShell script to send an e-mail. But the same problem occurs there, and above is the easiest way I could break it down to not working.

All other values of the task remain default values, so the task will run under the current user and only if he is logged on.

I don't know if it matters, but it is a Windows Server 2016 Datacenter edition (version 1607) running on Amazon AWS in an EC2 instance.

Any help would be appreciated, as I already spent hours and hours of research and trial & error, but without any success. Googling the above error message - especially together with that exact error code - doesn't reveal anything useful.

5
  • @Hi, I'm unclear on the triggers and actions? In the end you want to run a powershell script to send you an email, triggered by some event? On your example using "notepad.exe" as an event trigger, did you registered the task as admin? The thing is in my machine it states the app as owned by the admin
    – dmb
    Dec 18, 2018 at 18:15
  • Yes, in the end I want to run a PS script instead of notepad.exe. But I still want an event as a trigger, but this does not work. I tried creating the task with different users (current user who is local admin, LOCAL SERVICE, NETWORK SERICE, SYSTEM), with and without elevation, but none of that worked. What do you mean by "app"?
    – Tobias
    Dec 19, 2018 at 6:58
  • Ok, that’s why I asked. Triggers are the conditions to be met in order for your psScript to run. So in this case you can trigger the event by schudle, or by some event. Like user login, logout, etc. I think you got them mixed up. Have you tried running it on a set date?
    – dmb
    Dec 19, 2018 at 11:34
  • What do you think I got mixed up? Yes, I tried it with a fixed schedule, just for testing, and that worked. Only when I set the trigger to an event, it does not work and gives the error message.
    – Tobias
    Dec 19, 2018 at 12:32
  • I'm suddenly having a similar problem with a scheduled task set to trigger daily and repeat every 15 minutes for 16 hours. The task used to repeat just fine, but now it starts once at the scheduled time and that's it.
    – drzaus
    Jul 11, 2019 at 19:26

0

You must log in to answer this question.

Browse other questions tagged .