PowerShell script exchange
Post Reply
MauriceM
Service Provider
Posts: 5
Liked: never
Joined: Oct 23, 2017 3:38 pm
Contact:

Jobs Without Secondary Target

Post by MauriceM »

Hello,

I was wondering if its possible to list jobs without a secondary target using powershell. I've done some searching but I can't seem to find that property anywhere. Has anyone found a way to do this?

I found a thread from 2016 also looking for this info: https://forums.veeam.com/powershell-f26 ... 39253.html

Thank you!
MaxKozlov
Influencer
Posts: 19
Liked: 5 times
Joined: Oct 26, 2017 12:52 pm
Full Name: Max Kozlov
Contact:

Re: Jobs Without Secondary Target

Post by MaxKozlov » 1 person likes this post

look at LinkedJobs, LinkedJobIds properties for Job object
seems there is reverse link from secondary to primary
MauriceM
Service Provider
Posts: 5
Liked: never
Joined: Oct 23, 2017 3:38 pm
Contact:

Re: Jobs Without Secondary Target

Post by MauriceM »

Thanks Max, I'll take a look.

EDIT
Unfortunately this property was emtpy for my jobs but I wonder if I can't link them for this purpose.
benyoung
Veeam Software
Posts: 149
Liked: 47 times
Joined: May 25, 2016 3:29 am
Full Name: Ben Young
Contact:

Re: Jobs Without Secondary Target

Post by benyoung »

Not sure if you are specifically looking for jobs with a secondary target of tape job at all but I just wrote a script to automate this on our side, could be adapted to fit your other secondary requirements though

Get-VBRJob - matching specifically the jobs i want/could be all

Get-VBRTapeJobs - gets all of my tape jobs

Now loop through the tape jobs, pulling out each of values (backup jobs) in tapeJob.Object, adding each to a global arraylist

Now loop through the jobs from the Get-VBRJob and check to see if the object arraylist contains the backupjob.Name, adding non-compliant jobs to a list

We are reporting on this but also taking action around the non-compliant jobs (that are not in a secondary destination which happens to be our tape job) by looping through them, randomly selecting from our pool of tape jobs and adding it
MauriceM
Service Provider
Posts: 5
Liked: never
Joined: Oct 23, 2017 3:38 pm
Contact:

Re: Jobs Without Secondary Target

Post by MauriceM »

@benyoung - Thanks for the input. I'm only running vmcopy jobs at the moment but I'm sure I'll end up needed one for tape eventually.

I ended up using a seperate script to export the copy job settings. It seems you cant show the vmcopyjob associated with a backup job. You can however show the backupjob that the vmcopyjob contains.

Code: Select all

$BackupJobID = $job.linkedjobids.guid
$BackupJobName = get-vbrjob | where {$_.id -eq $BackupJobId} | select name
$jobOptions | Add-Member -MemberType NoteProperty -Name "Backup Job" -value $BackupJobName

My script is a modified version of this: https://www.virtualtothecore.com/en/che ... owershell/
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests