Powershell Script for Windows Server Backup Notification

Purpose

Script

Schedule

Revisions

Purpose

Windows Server Backup is a simple, yet very effective means to back up your Windows servers, but it does not have any built in email notification. This Powershell script can be scheduled to send the latest backup results via email.

Script

# Script to retrieve and send Windows Server Backup results

# Author: Syndeo Technologies

# Created: PS112817

$pol=Get-Wbpolicy|out-string

$sum=get-wbsummary|out-string

$lbackup=get-wbsummary|select LastBackupTime

$body=$pol+$sum

$subject="Latest Backup Results "+$lbackup

Send-MailMessage -To <targetemail> -From <sourceemail> -Subject $subject -Body $body -Smtpserver <smtpserver>

Schedule

Use Task Scheduler to run this script after the backup completes.

IMPORTANT: Make sure that you check off the box “run with highest privileges” if you run this as a scheduled task.

Revisions

PS112817

Initial Version

PS121317

Added note on highest privileges

THIS INFORMATION IS PROVIDED “AS IS” WITH NO WARRANTY OF ANY KIND AS TO THE ACCURACY OF ITS CONTENT.