What It Does
The script is read-only. It looks for the backup products it supports, reads the evidence each one leaves on this machine, and writes one row per product found, with when it last succeeded and how its newest run ended. It alerts, with exit 1, when a product's newest run failed, when there is no completed backup or its last success is older than MaxAgeHours, or when a service-only product has an automatic service that is not running. It is SKIPPED when no supported product is found.
Evidence comes from the event logs for Veeam Agent for Windows, Veeam Backup and Replication, Windows Server Backup and Macrium Reflect, and each row states how far to trust it. For Acronis Cyber Protect, Datto Windows Agent and Synology Active Backup for Business, the script checks service state because it cannot read a local backup result. Recent Acronis error events are counted in Evidence and do not trigger an alert. Macrium falls back to service checks when it finds no matching events. A service-only result can be OK even though the backup result is unknown. Check the backup console for those products.
A run that finished with a warning counts as a completed backup and is shown as Warning. The warning alone does not alert, but the age limit still applies. Results are read per product, not per job, so a failed job followed by a successful job of the same product reads as the newest result. Only event IDs, event levels, provider names and service names are used, never message text.
Before You Run It
- Set MaxAgeHours to your backup schedule plus some slack. The default is 26 for a nightly backup.
- Check the backup console as well for the service-only products, which cannot report a result here.
- Know that a failed job followed by a successful job of the same product reads as a success.
- Run it as an administrator or SYSTEM so it can read the event logs.
Type and Risk
- Type: Monitor. It checks one condition. It exits 1 when it finds the problem, so your RMM can alert on it, 0 when all is well, and 2 when it could not run.
- Risk: Low. It reads and changes nothing.
- Restart: It never restarts the machine.
- Typical run: Under 20 seconds.
- Example answer: "Veeam Agent for Windows: last success 5 h ago; Windows Server Backup: last success 19 h ago"
- Tested before listing on Windows 11 with Windows PowerShell 5.1, run as SYSTEM, against its own test cases.
Inputs
Pass an input as an argument (-Name value), as an environment variable with the same name, which is how most RMMs pass script variables, or change its default in the param() block at the top of the script. An argument wins over an environment variable, which wins over the default.
- MaxAgeHours: Alert when a product's newest successful backup is older than this many hours. Whole number, 1 to 8760. Default 26 (a nightly backup plus slack).
Every script also takes DryRun, OutputFormat (Text, Answer, Json or Csv), ExportPath and ResultField, which writes the answer to an RMM custom field.
License
Provided "as is" under the MIT License, without warranty of any kind. Test before production use. MSP Outpost and User First Digital Inc. accept no liability for any damage or loss.