i have created a PowerShell GUI which triggers the Veeam.Backup.Validator.exe
At the current version, you are able to choose a .vbk or .vbm file to validate your backups in it.
After you chose a file, you can select whether you want a XML or HTML report. By chosing an output folder, the GUI starts to validate your files.
Also, you are able to see the progress, as it opens up a new cmd window where the validation happens.
Here is the code:
Code: Select all
<#
.NAME
Veeam Backup Validator PowerShell GUI
.SYNOPSIS
Use this free tool to validate your Veeam Backups with the built-in Veeam.Backup.Validator.exe
.DESCRIPTION
Released under the MIT license.
.LINK
https://github.com/falkobanaszak
.VERSION
0.1
#>
#region begin GLOBAL VARIABLES {
$Global:SelectedFile =$Null
$ValidatorPath = 'C:\Program Files\Veeam\Backup and Replication\Backup'
$InitialDirectory = [Environment]::GetFolderPath('Desktop')
#$ReportLocation="C:\Temp\"
$ReportName="Veeam-Backup-Validation-Report_$(get-date -f dd-MM-yyyy-hh-mm-ss)"
#endregion GLOBAL VARIABLES}
#region begin FUNCTIONS {
Function Choose-File($InitialDirectory)
{
Add-Type -AssemblyName System.Windows.Forms
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$OpenFileDialog.Title = "Please Select File"
$OpenFileDialog.InitialDirectory = $InitialDirectory
$OpenFileDialog.filter = "Veeam Backup File (*.vbk)|*.vbk|Veeam Backup Metadata File (*.vbm)|*.vbm"
If ($OpenFileDialog.ShowDialog() -eq "Cancel")
{
[System.Windows.Forms.MessageBox]::Show("No File Selected. Please select a file !", "Error", 0, [System.Windows.Forms.MessageBoxIcon]::Exclamation)
}
$Global:SelectedFile = $OpenFileDialog.FileName
#$OpenFileDialog.ShowDialog() | Out-Null
}
Function Choose-Folder($InitialDirectory)
{
Add-Type -AssemblyName System.Windows.Forms
$OpenFolderDialog = New-Object System.Windows.Forms.FolderBrowserDialog
$OpenFolderDialog.ShowDialog() | Out-Null
$Global:SelectedFolder = $OpenFolderDialog.SelectedPath
}
#endregion FUNCTIONS}
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Application]::EnableVisualStyles()
#Set-Location -Path 'C:\Program Files\Veeam\Backup and Replication\Backup'
#region begin VBVGUI{
$VBVGUI = New-Object System.Windows.Forms.Form
$VBVGUI.ClientSize = '300,275'
$VBVGUI.text = "Veeam Backup Validator GUI"
$VBVGUI.TopMost = $false
$VBVGUIlblInfo = New-Object System.Windows.Forms.Label
$VBVGUIlblInfo.Text = "Use this GUI to validate your Veeam Backups"
$VBVGUIlblInfo.AutoSize = $true
$VBVGUIlblInfo.Location = New-Object System.Drawing.Point(15,15)
$VBVGUIlblInfo.Font = 'Microsoft Sans Serif,10'
$VBVGUIValidateButton = New-Object System.Windows.Forms.Button
$VBVGUIValidateButton.text = "Choose Folder and Start Validation"
$VBVGUIValidateButton.width = 120
$VBVGUIValidateButton.height = 40
$VBVGUIValidateButton.location = New-Object System.Drawing.Point(90,155)
$VBVGUIChooseFile = New-Object System.Windows.Forms.Button
$VBVGUIChooseFile.text = "Choose .vbk or .vbm"
$VBVGUIChooseFile.width = 120
$VBVGUIChooseFile.height = 30
$VBVGUIChooseFile.location = New-Object System.Drawing.Point(90,50)
$VBVGUIXMLReport = New-Object System.Windows.Forms.RadioButton
$VBVGUIXMLReport.text = "Create XML Report"
$VBVGUIXMLReport.AutoSize = $true
$VBVGUIXMLReport.width = 104
$VBVGUIXMLReport.height = 20
$VBVGUIXMLReport.location = New-Object System.Drawing.Point(10,100)
$VBVGUIXMLReport.Font = 'Microsoft Sans Serif,10'
$VBVGUIHTMLReport = New-Object System.Windows.Forms.RadioButton
$VBVGUIHTMLReport.text = "Create HTML Report"
$VBVGUIHTMLReport.AutoSize = $true
$VBVGUIHTMLReport.width = 104
$VBVGUIHTMLReport.height = 20
$VBVGUIHTMLReport.location = New-Object System.Drawing.Point(160,100)
$VBVGUIHTMLReport.Font = 'Microsoft Sans Serif,10'
$VBVGUIHTMLReport.Checked = $true
$VBVGUIDisclaimer = New-Object System.Windows.Forms.Label
$VBVGUIDisclaimer.text = "Copyright (c) 2019 Falko Banaszak`n`nDistributed under MIT license."
$VBVGUIDisclaimer.AutoSize = $true
$VBVGUIDisclaimer.location = New-Object System.Drawing.Point(35,200)
$VBVGUIDisclaimer.Font = 'Microsoft Sans Serif,10'
#endregion VBVGUI}
$VBVGUIChooseFile.Add_Click({
Choose-File
#[System.Windows.Forms.MessageBox]::Show("The following file has been selected: $Global:SelectedFile" , "Information", 0, [System.Windows.Forms.MessageBoxIcon]::Information)
})
$VBVGUIValidateButton.Add_Click({
If ($Global:SelectedFile -eq $Null)
{
[System.Windows.Forms.MessageBox]::Show("No File Selected. Please select a file !", "Error", 0, [System.Windows.Forms.MessageBoxIcon]::Exclamation)
}
else
{
IF ($VBVGUIXMLReport.Checked -eq "True")
{
Choose-Folder
#$ReportString="$ReportLocation"+"$ReportName"+".xml"
$ReportString="$Global:SelectedFolder"+"\"+"$ReportName"+".xml"
Set-Location -path $ValidatorPath
Start-Process cmd.exe -Wait "/c .\Veeam.Backup.Validator.exe /file:$Global:SelectedFile /report:$ReportString /format:xml"
[System.Windows.Forms.MessageBox]::Show("Validation process finished !" , "Information", 0, [System.Windows.Forms.MessageBoxIcon]::Information)
}
Else
{
Choose-Folder
#$ReportString="$ReportLocation"+"$ReportName"+".html"
$ReportString="$Global:SelectedFolder"+"\"+"$ReportName"+".html"
Set-Location -path $ValidatorPath
Start-Process cmd.exe -Wait "/c .\Veeam.Backup.Validator.exe /file:$Global:SelectedFile /report:$ReportString"
[System.Windows.Forms.MessageBox]::Show("Validation process finished !" , "Information", 0, [System.Windows.Forms.MessageBoxIcon]::Information)
}
}
})
$VBVGUI.Controls.AddRange(@($VBVGUIlblInfo,$VBVGUIValidateButton,$VBVGUIXMLReport,$VBVGUIHTMLReport,$VBVGUIDisclaimer,$VBVGUIChooseFile))
[void] $VBVGUI.ShowDialog()
Or on github: https://github.com/falkobanaszak/veeam- ... idator-gui
PS: Please be aware of, that mapped network drives won't work as the command line tool itself does not support it. https://www.veeam.com/kb2086
I appreciate any kind of feedback for further developing that tool, either on my blog or here in the forums.
Thank you all and Best Regards !
Falko
Features to consider:
- Validating a single VM out of a backup file
- Validating a single VM out of a backup Job
- Validating a single VM out of a backup Job with date and time