Sunday, December 7, 2014

Windows Server 2012: How to create a scheduled PowerShell task?

Sometimes you just need to have a task firing at certain times. In my case I had to run a PowerShell script every night. Of course I didn't want to get up every time so I created a scheduled task.

1) Use "Win + Q" or open the search and enter "Task Scheduler"

2) Right click and and look for "Create New Task" in the menu.

3) To add a PowerShell script, first click on "Actions"

4) Under "Program/script:" enter "PowerShell". Next to "Add arguments (optional):" add the path to the script. It won't work if you just enter the path to the script under "Program/script" as far as I know.

And that's it! Now your PowerShell script will run depending on the schedule you implemented.

No comments:

Post a Comment