How can I run a script when my PC is unlocked?

0
4
Asked By MysticGamer42 On

I have a PowerShell script that works perfectly when a user logs into the system. However, I want it to execute when the user unlocks the PC as well. I've tried setting this up in Task Scheduler, and while I can see that PowerShell activates, the actual script isn't running. What am I doing wrong?

3 Answers

Answered By CodeMaster007 On

Could you share the setup for your scheduled task? It might help troubleshoot the issue.

Answered By TechWhiz89 On

Make sure you're creating a regular task instead of a basic one. Set the trigger to "On workstation unlock" to get it to work when you unlock your PC.

Answered By ScriptGuru12 On

I once made a similar task triggered by specific event viewer events. It could be worth looking into that approach.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.