Monday, November 11, 2013

Automate that Script

A few lines of Powershell commands is a great start, but setting up a scheduled task is essential to getting the most out of your scripts.

The Task Scheduler has been around so long that this might not even seem worth noting, but there are two steps to help get your script running consistently.

1) When setting up your Action, make sure to select "Start a program".  Next, in the box for "Program/script:" enter the path to where Powershell is located (likely C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe).  Finally the path \ script should be entered into the "Add arguments..." box.

2) The other key for our setup has been to change the task to run under a service account, and also select "Run whether user is logged on or not".