How to run a program on log on of any user in Windows 10?

0

1

Note: Read, before you vote for duplicate question!

I need to execute a program on every log on. By that I used these energy settings to test the behaviour:
enter image description here

And I force the log on screen on wakeup, too:
enter image description here

Now I created a new task and created a trigger for At log on of any user, but it never fires. It fires only if I restart my machine completely or it wakes up from hibernation but not if only the monitors are switched on again.

I did some research and some people suggest to use the event id 42 or 1 as trigger, but this does not work for Windows 10.

Is there a separate event for "log on after monitor wake up"?

mgutt

Posted 2017-01-09T11:35:23.393

Reputation: 433

Possible duplicate of Trigger Task Scheduler in Windows 7 when computer wakes up from sleep/hibernate

– Bungicasse – 2017-01-09T11:37:37.273

@Bungicasse No its not. You should read the question first. – mgutt – 2017-01-09T11:53:35.423

Answers

0

Maybe there is an easier way (feel free to answer), but this is how I solved it by myself:

1.) Open the Group Policy Editor by running gpedit.msc in the windows search.

2.) Navigate to Local Computer Policy -> Computer Configuration -> Windows Settings -> Security Settings -> Advanced Audit Policy Configuration -> System Audit Policies - Local Group Policy -> Logon/Logoff and activate the monitoring for Audit Logon and Success
enter image description here

3.) Now create your task and set a trigger for the protocol Security, the source Microsoft Windows security auditing. and the event 4624
enter image description here

Finished!

mgutt

Posted 2017-01-09T11:35:23.393

Reputation: 433