Running Script from Task Scheduler

Welcome Forums General PowerShell Q&A Running Script from Task Scheduler

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
10 months, 2 weeks ago.

  • Author
    Posts
  • #90841
    Bob

    Participant
    Points: 0
    Rank: Member

    I have a script that works fine as long as it can run in the foreground, or active session. However, if I don't have it set to "Run only when user is logged on" it fails. I would like to get this moved over to unattended on a server. Is there a way to force Scheduler to run the script in the primary session?

  • #90844

    Participant
    Points: 22
    Rank: Member

    You have to have it set to "Run whether user is logged on or not" and check the "Do not store password." option. Then enter your password (or the password of the service account).

    You can also use PowerShell to register the scheduled tasks. Check out this article:
    https://blogs.technet.microsoft.com/heyscriptingguy/2015/01/13/use-powershell-to-create-scheduled-tasks/

The topic ‘Running Script from Task Scheduler’ is closed to new replies.