-
- Service Provider
- Posts: 242
- Liked: 44 times
- Joined: Jun 10, 2019 12:19 pm
- Full Name: Daniel Johansson
- Contact:
GetChildJobs() gone in v11
>> $job = Get-VBRComputerBackupJob -Name "Linux agents"
>> $job.GetChildJobs()
> Method invocation failed because [Veeam.Backup.PowerShell.Infos.VBRComputerBackupJob] does not contain a method named 'GetChildJobs'.
GetChildJobs() seems to have been removed. What is the new way to access child jobs created by agent jobs?
>> $job.GetChildJobs()
> Method invocation failed because [Veeam.Backup.PowerShell.Infos.VBRComputerBackupJob] does not contain a method named 'GetChildJobs'.
GetChildJobs() seems to have been removed. What is the new way to access child jobs created by agent jobs?
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: GetChildJobs() gone in v11
Hi Daniel,
To be precise, GetChildJobs() method has never been in VBRComputerBackupJob class. This class is related to the fixed Powershell API and has no public static methods besides common ones. As far as I see, GetChildJobs() was removed from CBackupJob class in v10, for which I don't know the reason. But it was never supported anyway.
Could you tell me please what are you trying to achieve? It looks like you may find GetWorkerJobs() or FindChildJobs() method in CBackupJob class fitting (instantiated with Get-VBRJob cmdlet).
Thanks,
Oleg
To be precise, GetChildJobs() method has never been in VBRComputerBackupJob class. This class is related to the fixed Powershell API and has no public static methods besides common ones. As far as I see, GetChildJobs() was removed from CBackupJob class in v10, for which I don't know the reason. But it was never supported anyway.
Could you tell me please what are you trying to achieve? It looks like you may find GetWorkerJobs() or FindChildJobs() method in CBackupJob class fitting (instantiated with Get-VBRJob cmdlet).
Thanks,
Oleg
-
- Service Provider
- Posts: 242
- Liked: 44 times
- Joined: Jun 10, 2019 12:19 pm
- Full Name: Daniel Johansson
- Contact:
Re: GetChildJobs() gone in v11
I want to list all servers in the backups of a job (of any type). If the job is an agent job, I have done like this:
I was never able to find out why $backup.GetOibs() return nothing for some agent backups, but I found that I in those cases can find the objects in backup with the workaround seen above. This has worked fine up to v10a. Now in v11 I need to rewrite it. I will look at the methods you suggested.
Code: Select all
$oibs = $backup.GetOibs()
if (!$oibs.Count) { $oibs = $job.GetChildJobs().GetLastBackup().GetOibs()
-
- Service Provider
- Posts: 242
- Liked: 44 times
- Joined: Jun 10, 2019 12:19 pm
- Full Name: Daniel Johansson
- Contact:
Re: GetChildJobs() gone in v11
Oh, and an addition. $job was set like this in the script:
in order to get the job regardless of job type. Now as I tested it at the prompt I used Get-VBRComputerBackupJob since I already knew it is an agent job.
Code: Select all
$job = [Veeam.Backup.Core.CBackupJob]::GetAll()|?{$_.Name -eq $param_jobname}
-
- Service Provider
- Posts: 242
- Liked: 44 times
- Joined: Jun 10, 2019 12:19 pm
- Full Name: Daniel Johansson
- Contact:
Re: GetChildJobs() gone in v11
It was as easy as replacing GetChildJobs() with FindChildJobs(). Somehow I missed it when I tabbed through all available methods. Thanks!
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: GetChildJobs() gone in v11
Glad you could figure it out. Thanks!
Who is online
Users browsing this forum: No registered users and 19 guests