How to Schedule a Powershell Script to Run on Windows 2008


It is a little bit tricky to configure a Powershell  script to run on the task scheduler on Windows 2008.

The separation between the powershell.exe command and the arguments makes a little confusion.

The way I did it was:

  • Create a new task.
  • Define a schedule.
  • Add an action:
    • Program/script: Powershell
    • Add arguments: -command &{E:\scripts\ClearIISLogs.ps1}

Now you just need to run your script and make sure it works as expected.

 

See you,

Amadeu.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: