Set a Scheduled Task to run when user isn't logged in

前端 未结 5 1214
一整个雨季
一整个雨季 2020-12-05 07:02

I have been using the Powershell Scheduled Task Cmdlets to create a scheduled task on our servers.

How do I elect to \'Run whether user is logged in or not\' using

5条回答
  •  佛祖请我去吃肉
    2020-12-05 07:29

    Once you have the task set up in the gui, run this

    $task = Get-ScheduledTask "test task for notepad"
    $task.Principal.LogonType = "Password"
    Set-ScheduledTask $task
    

提交回复
热议问题