PowerShell script exchange
mcsmithSOP
Enthusiast
Posts: 42
Liked: 2 times
Joined: May 31, 2015 3:26 pm
Full Name: Jason
Location: Regina, SK, CAD
Contact:

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

Post by mcsmithSOP » 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

v.eremin
Product Manager
Posts: 16192
Liked: 1322 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by v.eremin » 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.

jhellermann
Novice
Posts: 9
Liked: 2 times
Joined: May 10, 2016 12:05 pm
Full Name: JEllermann
Contact:

[MERGED] Powershell script for validating backup jobs (teste

Post by jhellermann » 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

v.eremin
Product Manager
Posts: 16192
Liked: 1322 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by v.eremin » 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.

jhellermann
Novice
Posts: 9
Liked: 2 times
Joined: May 10, 2016 12:05 pm
Full Name: JEllermann
Contact:

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

Post by jhellermann » Feb 14, 2017 1:01 pm

Good idea
JEllermann

v.eremin
Product Manager
Posts: 16192
Liked: 1322 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by v.eremin » 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.

Tecbil
Influencer
Posts: 18
Liked: 2 times
Joined: Apr 08, 2016 6:20 am
Full Name: Fabio Di Taranto
Contact:

Re: [MERGED] Powershell script for validating backup jobs (teste

Post by Tecbil » Feb 04, 2019 7:46 am 1 person likes this post

jhellermann wrote:
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)

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


Thanks a lot dude. Exactly what I was looking for and it works like a charm.

jhellermann
Novice
Posts: 9
Liked: 2 times
Joined: May 10, 2016 12:05 pm
Full Name: JEllermann
Contact:

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

Post by jhellermann » Feb 18, 2019 8:52 am

Nice to hear
JEllermann

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests