You might want to try this:
Save this snippet to VEBClose.ps1:
Code: Select all
$VEBStatus = get-winevent -FilterHashtable @{Logname='Veeam Endpoint Backup';ID=190} -MaxEvents 1| Format-List -property Message | out-string | Foreach {$_.Trim()} | where {$_ -ne ""}
if ($VEBStatus.contains("Success")) {
Get-Process Veeam.EndPoint.Tray | ? { $_.CloseMainWindow() | Out-Null }}
} else {
[System.Windows.Forms.MessageBox]::Show("Something went wrong - check VEB!`n`n$VEBStatus","Ooops!",[System.Windows.Forms.MessageBoxButtons]::OK,[System.Windows.Forms.MessageBoxIcon]::Stop)
}
Create a scheduled task that runs as current user, add a "event" trigger (Veeam Endpoint Backup, EventID 190) and let it start "powershell" with argument "<path>\VEBClose.ps1.
If the backup was successfull, the VEB window will be closed, otherwise a messagebox come up and VEB stays open.
That's a quick and dirty approach and I didn't test it thoroughly.
Sascha