Hi, I'm trying to figure out how to generate a report in Log Analytics/PowerShell that will list VM's that have backed up successfully and which did not. Does anyone have an idea of how I can do this via PowerShell or using Log Analytics?
If you backup through Azure, Log Analytics has a solution you can install, named "Azure Backup Monitoring solution" with a dashboard of many backup details:
You can drill through the charts to see the raw query and results in Log Analytics, or write a custom query like this:
| where TimeGenerated > ago(6d)
| where Category == "AzureBackupReport"
| where OperationName == "Job"
| where JobOperation_s == "Backup"
| summarize AggregatedValue = dcount(JobUniqueId_g) by JobStatus_s
| order by AggregatedValue desc
which counts how many backup jobs were successful or failed.
If you backup through another process, you can track the events reported on the Event / SecurityEvent tables.