Using Scheduled Tasks with SmarterStats

Some features within SmarterStats require that the IIS site used by SmarterStats is active and available. For example, things like scheduled email reports. The emailing of daily, weekly, or monthly reports in SmarterStats runs as a background task. If there has been no activity on the SmarterStats site for some time, IIS may stop it. As a result, email reports will not be processed until there is some activity on the site, such as navigating to the SmarterStats login page.

Previously, customers could use the SmarterPing service offered by SmarterTools. However, as that has been deprecated, using Scheduled Tasks in Windows is a better and more reliable option.

In order to ensure IIS keeps the site active, you can set up a Scheduled Task in Windows. Below is a step-by-step guide on how to set up a task that will keep the SmarterStats site available.

First, you will want to open Task Scheduler. In order to do that:

  1. Press Win + R to open the Run dialog, then type taskschd.msc in the Open dialog and press Enter.
  2. Alternatively, you can start typing "task" in the Search Bar and select Task Scheduler.
Once Task Scheduler is open you'll want to create a new Task. To do that:
  1. Click on Task Scheduler (local), then select Create Task from the Actions pane on the right.
The Create Task window will open. Here, is where you'll create your task. The options to enter for each tab are listed, below:

General Tab
  1. First, give the task a Name. It can be anything you want, but should probably be something descriptive, such as "Daily Curl Task".
  2. Next, add a Description. Again, this should be pretty descriptive, such as "Daily curl task to keep SmarterStats IIS site(s) awake."
  3. For Security options, set the task to Run whether user is logged on or not, and then select Run with highest privileges.
Triggers Tab
  1. Click New to create a new trigger.
  2. Select On a schedule to Begin the task.
  3. Choose Daily and have the task Recur every: 1 days.
  4. Change the start time to 00:30. (12:30 am)
  5. There's no need to set any of the Advanced settings.
  6. Click the OK button.
Actions Tab
  1. Click New to create a new action.
  2. Set the action to Start a program.
  3. In the Program/script field, type curl.
  4. In the Add arguments (optional) field, type the location of the SmarterStats website with a -l at the end. Using the default URL for SmarterStats, this would look like this: http://localhost:9999/Login.aspx -I
  5. Click the OK button.
Conditions and Settings Tabs (Optional)
Adjust any additional conditions or settings as needed. For instance, you can set the task to only run if the computer is idle or powered on AC.

Finish
Once all the General, Triggers, Actions, Conditions, and Settings are set, click the OK button to actually create the task. NOTE: You may be prompted to enter your user credentials in order to save the task.

Once all this is done, you've created a Scheduled Task that will keep the SmarterStats website alive so that any automated functions will run whether someone logs into the site or not.