In my report script, I want to list backup stats per agent in an agent management job. The method below worked at least in 11a and maybe in 12 (Not sure because the VBR server I run most scripts from was upgraded directly from 11a to 12.1). This no longer works, the $backup array remains empty. I can find all the backup files using GetAllChildrenStorages() on the agent management job, but right now I can't see an easy method to separate these into one collection of backup files per agent. The only obvious way I see is to check the beginning of PartialPath, which is very kludgy.
Footnote: I use the method shown to get $job just to avoid the warning that Get-VBRJob is deprecated for agent jobs, and to use Get-VBRComputerBackupJob instead, but a job returned by that method does not have a FindChildJobs() method.
Hi @DanielJ, this may be related to a known issue in v12 with Get-VBRBackup cmdlet. Please open a case and share a copy of your Veeam Configuration database if your company's data export policies allow this (KB: https://www.veeam.com/kb1471), and ask the Support Engineer to review issue 609235.
I suspect it's this, but let's allow the Support Team to confirm.
David Domask | Product Management: Principal Analyst
Question - does Get-VBRBackup cmdlet in your script return agent backups at all? I tested in 12.1 and I'm also getting empty array in $backup, but Get-VBRBackup does return agent backups in my case.
It does, but only for the management job, not for the child jobs. I rewrote the function so it uses FindChildBackups() instead, which made it much simpler than finding the child jobs and then find the backups for those. I don't think I noticed that function before, maybe it is a recent addition.