I'm trying to have a simple PowerShell script start at Windows session login or logoff...
the script runs ok with manual launch the script runs ok when launched by scheduled task at a specific time (and I'm logged in as admin) But it doesn't run with a launch at logon or logoff.
In the task scheduler I have the following :
my account (with admin rights) is designated to run the script
the button "run if not connected" is on
the box "execute with highest priv" is checked
trigger : "when connecting to a win session" / any user / local connexion / Advanced parameters "Activate" box is checked
action : powershell.exe with arguments : -noprofile -executionpolicy Bypass -File .\wlem.ps1 / start in c:\public
no condition box is checked
Thanks for the help :-)
history
tab?At log on
)? I thinkOn connection to user session
only applies connecting to an existing session. For logoff, useOn an event
with theSystem
log,Winlogon
source and event ID7002
.