Backup Validator - PS Script to run against all backups

PowerShell script exchange

Re: Backup Validator - PS Script to run against all backups

Veeam Logoby mcsmithSOP » Thu Jan 07, 2016 5:31 pm

This tool is failing on all the VMs in the job due to "VM is unavailable".

Veeam B&R is installed on one server (veeam), and the repository is stored on a different server (vmbr-pri). I'm assuming that the issue is because the Storage Path in the report is "F:\Backups\Debian\Debian2016-01-06T223135.vib".

That is the correct path on the repo (vmbr-pri) but obviously does not exist on the B&R server (veeam) where the tool is installed.

I ran a SureBackup on a couple of the VMs yesterday, so I know that they work and are valid (or at least, they were yesterday afternoon).

I'd like to run this validator tool more frequently that the SureBackup jobs, since I don't want to run SureBackup jobs during week days, so help getting the path correct would be appreciated.

Edit to add: Running Veeam 8.0 Update 3. B&R is on WS2012R2 and the repo is on WS2008R2
mcsmithSOP
Enthusiast
 
Posts: 42
Liked: 2 times
Joined: Sun May 31, 2015 3:26 pm
Location: Regina, SK, CAD
Full Name: Jason

Re: Backup Validator - PS Script to run against all backups

Veeam Logoby v.Eremin » Fri Jan 08, 2016 12:52 pm

I'm assuming that the issue is because the Storage Path in the report is "F:\Backups\Debian\Debian2016-01-06T223135.vib".

Correct. You might share the given location, and it to a backup server as a mapped drive, so that, validator tool has access to backup files.

Though, be aware that validator is not a replacement of Surebackup, since мalidator tests whether the backup file itself was modified/corrupted after being created, while SureBackup ensures that VMs in it are actually recoverable.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13279
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

[MERGED] Powershell script for validating backup jobs (teste

Veeam Logoby jhellermann » Thu Jan 19, 2017 12:01 pm

With this Powershell Script you can check a backup job.
Simply enter your job-name, mailserver, email, path and save it.
Test it with right mouse button, execute with powershell.
The job starts and checks the last backups of all VMs in the job.
Set Task in Task Scheduler, done.
Instead of /: backup you can also use /:file, but you must then change the parameters as
documented for the veeam.backup.validator.exe



Code: Select all

###########################################################################################################

$EMAILFROM = "veeamserver@blimblam.de"
$EMAILTO = "ToniMaroni@blimblam.de"
#$EMAILBCC = ""
#$EMAILCC = ""
$EMAILSUBJECT = "Backup-Validation"
$EMAILATTACHMENT = "D:\VeeamPowerShell\PShellLogs\BackupJob-Windows-Client.html"
$SmtpServer = "xxx.xxx.xxx.xxx"


###########################################################################################################

Add-PSSnapIn VeeamPSSNapin
set-location "C:\Program Files\Veeam\Backup and Replication\Backup"



.\Veeam.Backup.Validator.exe /backup:"BackupJob-Windows-Client" /format:html /report:"D:\VeeamPowerShell\PShellLogs\BackupJob-Windows-Client.html"

##################################################################################################################################################################################

$MESSAGE = new-object System.Net.Mail.MailMessage
$MESSAGE.From = $EMAILFROM
$MESSAGE.To.Add($EMAILTO)
#$MESSAGE.CC.Add($EMAILCC)
#$MESSAGE.Bcc.Add($EMAILBCC)
$MESSAGE.IsBodyHtml = $FALSE
$MESSAGE.Subject = $EMAILSUBJECT
$attach = new-object Net.Mail.Attachment($EMAILATTACHMENT)
$MESSAGE.Attachments.Add($attach)
$MESSAGE.body = $EMAILBODY
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25)
$SMTPClient.EnableSsl = $FALSE
#$SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“username“, “password“);
$SMTPClient.Send($MESSAGE)

###########################################################################################


JEllermann
jhellermann
Novice
 
Posts: 7
Liked: never
Joined: Tue May 10, 2016 12:05 pm
Full Name: JEllermann

Re: Backup Validator - PS Script to run against all backups

Veeam Logoby v.Eremin » Thu Jan 19, 2017 12:51 pm

Thanks for sharing the script. I'd probably assign location to a variable and let user define it, as installation directory might vary:

Code: Select all
$Location = "C:\Program Files\Veeam\Backup and Replication\Backup" # Change it, if the product is installed in non-default directory
################################################################################################################
Add-PSSnapIn VeeamPSSNapin
set-location $Location

Thanks.
v.Eremin
Veeam Software
 
Posts: 13279
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Backup Validator - PS Script to run against all backups

Veeam Logoby jhellermann » Tue Feb 14, 2017 1:01 pm

Good idea
JEllermann
jhellermann
Novice
 
Posts: 7
Liked: never
Joined: Tue May 10, 2016 12:05 pm
Full Name: JEllermann

Re: Backup Validator - PS Script to run against all backups

Veeam Logoby v.Eremin » Sat Feb 18, 2017 10:57 am

You're welcome. Glad to hear that you've found my input useful.

Feel free to reach us, should other help be needed.
v.Eremin
Veeam Software
 
Posts: 13279
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Previous

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 7 guests