Schedule reports and export to network share

What is a one sentence summary of your feature request?

Schedule a baseline/compliance report and export to file share

Please describe your idea in detail. What is your problem, why do you feel this idea is the best solution, etc.

We run weekly/monthly reports for a lot of different things. They get turned into dashboards with trending data using Power BI. Having the change tracker software automatically run that report > export to file share so Power BI can pull that report in and dashboard it would save a small amount of manual labor on my part.

How do you currently solve the challenges you have by not having this feature?

The reports automatically run weekly, I go through all 10 of them > export one at a time > copy to file share. The Overview pages work really well for me but the powers that be/ bean counters just want nice pretty dashboards with specific information. Not super important to add this feature but it would be a nice to have. I know I can have it set to email me but I get enough emails from Auditor :slight_smile:

Hi Phil,

Easiest path to this today will be to use the API, a script, and Windows Task Scheduler.

I’ve attached a script that worked in my lab. Full instructions included at the top of the script, which I’ve also included here.

Export-CTReports.ps1 — Setup Instructions

Automates pulling the latest completed Change Tracker report output(s) to a file share, so tools like Power BI can pick them up on a schedule without manual export.

What it does

Logs into the Hub API and, for each report ID listed, finds the most recently completed run, renders it in your chosen format, and downloads it to a folder or file share. It doesn’t trigger reports to run — it just picks up whatever Change Tracker’s own schedule already produced.

1. Customize before running

Edit the param() block at the top of the script (or pass these as arguments):

Setting What to set it to
$HubUrl https://localhost/api if running on the same server as the Hub, otherwise your Hub’s URL + /api
$OutputPath The folder or file share path your downstream tool (e.g. Power BI) reads from
$ReportItemIds One or more report IDs — see below for how to find these
$Format Csv, CsvXlsx, Pdf, Word, or Excel — same options as the report viewer’s Download button. Defaults to Csv.

If the Hub uses a self-signed/internal cert, uncomment the two $PSDefaultParameterValues["...:SkipCertificateCheck"] lines near the top of the script.

2. Finding your report IDs

Run this once (with your own admin credentials, or after setting the env vars from step 3) to list every scheduled report with its ID:

$HubUrl = "https://localhost/api"
$authBody = @{ UserName = "admin"; Password = "yourpassword"; provider = "credentials" } | ConvertTo-Json
Invoke-RestMethod -Uri "$HubUrl/auth/credentials" -Method Post -Body $authBody `
    -SessionVariable Session -ContentType "application/json" | Out-Null
$reports = Invoke-RestMethod -Uri "$HubUrl/reports/scheduled" -Method Get -WebSession $Session
$reports.Items | Select-Object Id, @{N='Name';E={$_.ContainerReport.DisplayName}} | Format-Table -AutoSize

Copy the Id value(s) for whichever reports you want exported into $ReportItemIds in the script.

3. Setting the credential environment variables

Run as the account that will execute the scheduled task (ideally a dedicated low-privilege service account, not a personal admin login):

[Environment]::SetEnvironmentVariable("CT_HUB_USER", "svc-reportexport", "User")
[Environment]::SetEnvironmentVariable("CT_HUB_PASSWORD", "REPLACE_ME", "User")

These only take effect in new sessions started after being set — close and reopen PowerShell before testing.

4. Windows Task Scheduler setup

  1. Save the script, e.g. C:\Scripts\Export-CTReports.ps1
  2. Open Task Scheduler → Create Task
  3. On the General tab: set it to run whether user is logged on or not, using the service account whose env vars you set in step 3
  4. On the Triggers tab: add a new trigger for Weekly/Monthly, matching your report cadence, timed a bit after the reports actually finish running in Change Tracker
  5. On the Actions tab: add a new action
    • Program/script: powershell.exe
    • Add arguments: -ExecutionPolicy Bypass -File "C:\Scripts\Export-CTReports.ps1"
  6. Save the task, then right-click it and select Run once to confirm it authenticates and drops a file on the share before trusting the schedule

Export-CTReports.ps1 (6.3 KB)