How to schedule a task wether the user is logged on or not in PowerShell? How to schedule a task wether the user is logged on or not in PowerShell? powershell powershell

How to schedule a task wether the user is logged on or not in PowerShell?


You'll need to specify a user (like /RU system), but it should be the default whether to run logged in or not. You can look at this link for a list of all schtasks.exe parameters.


if you add

/RU <username> /RP <password>

to the call to schtasks.exe you will get "Run whether user is logged on or not" selected.

You can also use the /NP instead, which will also give you "Run whether user is logged on or not", but also "Do not store password..." which will limit the accessible resources.


I got a Working solution, just add this:

/RU "NT AUTHORITY\SYSTEM" /RP *

Will run as System and ignore password, Tested on XP