PowerShell script exchange
Post Reply
DanielJ
Service Provider
Posts: 200
Liked: 32 times
Joined: Jun 10, 2019 12:19 pm
Full Name: Daniel Johansson
Contact:

12.1 - Can no longer find backups per agent

Post by DanielJ »

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.

Code: Select all

  $allbackups = Get-VBRBackup
  $alljobs = [Veeam.Backup.Core.CBackupJob]::GetAll()
  $job = $alljobs|?{$_.Name -eq 'Name of the agent management job'}
  $backup = @()
  $childjobs = $job.FindChildJobs()
  foreach ($childjob in $childjobs) {
    $backup += $allbackups|?{$_.JobId -eq $childjob.Id}
  }
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.
david.domask
Veeam Software
Posts: 1226
Liked: 322 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: 12.1 - Can no longer find backups per agent

Post by david.domask »

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
DanielJ
Service Provider
Posts: 200
Liked: 32 times
Joined: Jun 10, 2019 12:19 pm
Full Name: Daniel Johansson
Contact:

Re: 12.1 - Can no longer find backups per agent

Post by DanielJ »

Ticket 07096858 created.
arbcoll
Novice
Posts: 5
Liked: 1 time
Joined: Mar 07, 2019 10:05 am
Full Name: Arben Q
Contact:

Re: 12.1 - Can no longer find backups per agent

Post by arbcoll »

Hi Daniel,

Is there any update on the case? I think I might have the similar problem.
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: 12.1 - Can no longer find backups per agent

Post by oleg.feoktistov »

Hi @DanielJ,

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.

Best regards,
Oleg
DanielJ
Service Provider
Posts: 200
Liked: 32 times
Joined: Jun 10, 2019 12:19 pm
Full Name: Daniel Johansson
Contact:

Re: 12.1 - Can no longer find backups per agent

Post by DanielJ »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests