I was thinking of putting a script together to automate this, should this come back in the future.
I have found some usable snippets of code from following forum posts:
powershell-f26/how-to-manage-jobs-in-th ... 86341.html
powershell-f26/sobr-azure-offload-statu ... 65880.html
I currently have this incomplete non working code:
Code: Select all
#Connect to VBR
Connect-VBRServer
#Define SOBR offload job = Archivebackup
$sobrOffload = [Veeam.Backup.Model.EDbJobType]::ArchiveBackup
#Get running SOBR offload jobs
$runningSessionsArchiveBackup = [Veeam.Backup.Core.CBaseSession]::GetRunning($sobrOffload)
#write $runningSessionsArchiveBackup
$runningSessionsArchiveBackupOlderThan7days= [Veeam.Backup.Core.CBackupSession]::GetByTypeAndTimeInterval($runningSessionsArchiveBackup,(Get-Date).adddays(-7), (Get-Date).adddays(1))
write $runningSessionsArchiveBackupOlderThan7days
Cannot convert argument "jobType", with value: "Veeam.Backup.Model.CBaseSessionInfo[]", for "GetByTypeAndTimeInterval" to type "Veeam.Backup.Model.EDbJobT
ype": "Cannot convert the "Veeam.Backup.Model.CBaseSessionInfo" value of type "Veeam.Backup.Model.CBaseSessionInfo" to type "Veeam.Backup.Model.EDbJobType
"."
The goal here is to get the running SOBR Offload jobs, for example 7 days, and terminate the ones older than a given time.
If anyone can aid me in this, I would be very grateful