Run a Windows task on system unlock
You can't do it through any of the normal scheduler commands. But if you write an XML block that includes a SessionStateChangeTrigger, like
<SessionStateChangeTrigger>
<StateChange>SessionUnlock</StateChange>
</SessionStateChangeTrigger>
Then you can pass the whole XML block to Register-ScheduledTask:
Register-ScheduledTask -Xml $xml -Force





