PowerShell, Veeam  : Job status report

Veeam is a great application, with great Powershell support. You can do anything the application does and more from PowerShell.

I am just getting my teeth into automating a lot of our common Veeam tasks, but here is something simple to get us started.

Here is a simple script for that checks all of the Veeam backup and replication jobs and email a list of servers that have not succeeded.

Add-PSSnapin VeeamPSSnapin

$body = ''
$Jobs = Get-VBRjob

foreach ($Job in $Jobs)
{
if ($job.GetLastResult() -ne "Success")
    {
        $body += $job.GetLastResult() 
        $body += " "
        $body += $job.Name
        $body += "`n"
    }
}


Send-MailMessage -To "destination address" -From "Veeam@email.net" -Subject "Veeam Job status report" -Body $body -SmtpServer "monitoring.email.net" 

I will be adding more interesting bits as I get to them, so keep your eyes open.