This should help you out, as you need to filter based on the proper Nutanix job type even for a particular job ID.
You're on the right track with the '.GetTaskSessions()' method, but you're working with the incorrect job session object.
Sample script
This
other script will give a better breakdown of the job types, based on the following block of code:
Code: Select all
$AllJobs = [Veeam.Backup.Core.CBackupJob]::GetAll()
$Nutanix_Policy_Jobs = $AllJobs | Where-Object { $_.TypeToString -like "Nutanix*" -AND $_.JobType -eq "VmbApiPolicyTempJob" }
$Nutanix_VM_Jobs = $Nutanix_Policy_Jobs | Where-Object { $_.FindChildJobs().JobType -eq 'EndpointBackup' }
$Nutanix_Meta_Jobs = $Nutanix_Policy_Jobs | Where-Object { !($_.FindChildJobs()) }
$Nutanix_Snapshot_Jobs = $Nutanix_Meta_Jobs | Where-Object { $_.GetViOijs().TypeDisplayName -eq 'Virtual Machine' }
$Nutanix_PD_Jobs = $Nutanix_Meta_Jobs | Where-Object { $null -eq $_.GetViOijs().TypeDisplayName }
This is what I was able to differentiate when creating a requested report against VAN for v10 (these terms are just mine to explain as an abstract structure):
- Nutanix "Policy-based" jobs have a TypeToString matching 'Nutanix*', and a job type of 'VmbApiPolicyTempJob'
- Nutanix "VM-specific" jobs have child jobs with a job type of 'EndpointBackup'
- Nutanix "meta" jobs are policy jobs that have no child jobs
- Nutanix "snapshot jobs" are the meta jobs that have a job object which is of type 'Virtual Machine'
- Nutanix "Protection Domain" jobs are the meta jobs where the job objects have no type name
Typical caveats here... all of this is leveraging unsupported methods, and the structure/explanation of the jobs/types are all from creating a new lab environment and performing my own investigation. I have not confirmed that any of this code remains unchanged against a v11 instance.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion