i am using PRTG for Monitoring Veeam quite a while now with a self build powershell script.
Now as Veeam V10 has finally arrived i changed some of my complex BackupCopy Jobs to the new BackupCopy job type with intermediate Setting.
For the side of the backup all works fine, but my Powershell script cannot ready the results of the job and dig a little bit and found, that there are no VBR-Sessions which i could query using Powershell.
A quick very simplified overview:
The Old Setup:
1. Normal Backup Job which backups vm to a local target
1. Backup Copy Job for Offsite Replication scheduled after the Backup Job
The New Setup:
1. Normal Backup Job which backups vm to a local target
1. Backup Copy Job in Intermediate Mode for Offsite Replication
The Powershell
Code: Select all
Connect-VBRServer -Server $VeeamServer -User $VeeamUser -Password $VeeamPassword
$jobs = Get-VBRJob
foreach ($job in $jobs){
$lastSuccessSession = Get-VBRBackupSession -WarningAction SilentlyContinue | Where-Object {$_.jobId -eq $job.Id.Guid -and $_.State -eq "Stopped" } | Sort-Object EndTimeUTC -Descending | Select-Object -First 1
if($lastSuccessSession.Count -gt 0){
Write-Host "Type: $($job.JobType) Name: $($job.Name) has finished with $($lastSuccessSession[0].Result)"
}else{
Write-Host "Type: $($job.JobType) Name: $($job.Name) has no VBRBackupSessions)"
}
}
Disconnect-VBRServer -WarningAction SilentlyContinue
For sake of simplicty we are assume the jab has already run at least one time
Output with the "Old Setup"
Code: Select all
Type: Backup Name: Backup Local has finished with Success
Type: BackupCopy Name: To Offsite has finished with Success
Code: Select all
Type: Backup Name: Backup Local has finished with Success
Type: SimpleBackupCopyPolicy Name: To Offsite has no VBRBackupSessions
But as long as i searched the Powershell CMDlets in the Veeam Powershell Help Center i cannot find any way to query them.
I am not sure if this is supposed to happen, that the Get-VBRBackupSession does not return any information about the SimpleBackupCopyPolicy jobs or if there is simply another CMDlet i could't find.
Perhaps anyone has already stumbled over an solution or Veeam could tell us if this is "by Design" or i a missing something here.
Thank you for your time and help.
best regards
Michael