Creating a daily backup report
When performing backups of a system, one of the most critical components is reporting on the success or failure of the backups. With backup reports, you can prove that the backups are performing properly, resolve problems, identify recurring issues, and determine if the sizing and performance is sufficient for your environment.
In this recipe, we will create a basic backup report that will be sent to an Administrator every day. The report will capture the basic success and failure status for backups of a server.
Getting ready
For this recipe, we will be using a system configured similar to the first recipe, Configuring backup policies.
How to do it...
Define the report.
$now = Get-Date $startTime = $now.AddDays(-2) $myReport = "Backup Report for $Env:COMPUTERNAME on $now`n"
Query the backup sets.
$myReport += "`tBackup Sets" $myReport += Get-WBBackupSet | ` Where-Object BackupTime -gt $startTime | Out-String Get-WBBackupSet | where BackupTime -gt $startTime | Out-String...