Browse
Tools
Categories

Using Windows Task Scheduler

Reference Number: AA-01084 Views: 715 Last Updated: 02-07-2019 03:15 PM 0 Rating/ Voters

This article describes how to configure the Windows Task Scheduler to deliver a SiteAudit report.

Using Windows Task Scheduler to Generate Reports

This section describes how to schedule reports using the Windows Task Scheduler. Three files are required when creating a task to run a Hosted Client scheduled report. If scheduling reports for SiteAudit On-Site, then only two arguments are required. The following are samples of these arguments:

  1. The application file that is used to generate scheduled reports is located in the SiteAudit installation root folder:
    "C:\Program Files\Netaphor\SiteAudit\SiteAuditScheduledReports.exe"

  2. The .view file, which is the template created from a SiteAudit view. This file must contain the email recipient information and/or the archival information so that SiteAudit knows what to do with the report it generates. The .view file should be saved in a known location as the entire path and file name are needed when scheduling the task.
    "C:\Users\Public\Documents\Netaphor\SiteAudit\MyReports\Inventory.view"

  3. The keyfile that contains the information needed to access the hosted database for which the report is generated:
    "C:\Users\Public\Documents\Netaphor\SiteAudit\MyReports\sampledatabase.sakey"
Scheduled Task Parameters

  • Creating scheduled tasks for On-Site solutions requires items 1 & 2 above, whereas creating a scheduled task for Hosted deployments requires items 1, 2, & 3 above. 
  • The full path and file name is required for all files shown above. 
  • Quotes are required around the path and file name if any spaces exist.

The first step toward creating a scheduled report is to launch the Microsoft Windows Task Scheduler and create a new task. When a new task is created, the following dialog is shown.


Figure 1: Create Task dialog

Enter a Name for the task. This name is shown in the main Task Scheduler menu and should easily identify what the report is or what it contains. In this example, we are creating a monthly inventory report for CustomerX.

Enter a description that helps to identify the type of report that will be generated.

Select "Run with highest privileges."

Create a new trigger. The trigger identifies when or how frequently the report will be run. In this case, we want the report to be generated on the last day of each month.


Figure 2: New Trigger dialog

After defining the trigger, Task Scheduler must be told what task to run. This is done by creating a new Action. This is the most important aspect of creating the task as this is where the view file and key file are specified.   

In the Action drop-down, be sure that Start a program is selected. This should be selected by default.


Figure 3: Action dialog

In the Program/script text-box, enter the full path and file name for the SiteAuditScheduledReports.exe, which is located in the default root folder where SiteAudit was installed. This is typically:

  • C:\Program Files\Netaphor\SiteAudit

Remember to include quotations around the full path and file name when spaces exist. 

Next, it is necessary to enter the path and file name for the .view file. If creating a scheduled report for a Hosted Client database, including the -keyfile argument is required as well. The –viewfile and –keyfile arguments must precede the path and file name. For On-Site solutions, the -keyfile argument is not required and should not be entered.

Sample Argument for On-Site Solutions

  • -viewfile “C:\Users\Public\Documents\Netaphor\SiteAudit\MyReports\inventory.view” -culturename en-gb

Sample Arguments for Hosted Client Solutions

  • -viewfile “C:\Users\Public\Documents\Netaphor\SiteAudit\MyReports\inventory.view” –keyfile “C:\customers\keyfiles\customerX.sakey” -culturename en-bg

The task can then be saved and run to confirm that the expected report is generated and delivered to the correct recipients and/or archived to the file system.