14

I have an MVC app. I have a controller that when called runs a background process to query Active Directory and updates the database.

http://myapp/BackgroundTask/Run

I want to run this on a schedule (daily) without opening a browser. I see that there's a lot of third party solutions, is there something built in?

Jack
  • 537

1 Answers1

31

Use the Invoke-WebRequest cmdlet from Powershell.

In your task:

  • Action: Start a program
  • Program/script: powershell.exe
  • Arguments: -Command "Invoke-WebRequest http://myapp/BackgroundTask/Run"
Ryan Bolger
  • 17,010