Running Script from Task Scheduler

This topic contains 1 reply, has 2 voices, and was last updated by  Jeremy Corbello 2 weeks, 2 days ago.

  • Author
    Posts
  • #90841

    Bob
    Participant

    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

    Jeremy Corbello
    Participant

    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/

You must be logged in to reply to this topic.