PowerShell script exchange
Post Reply
JustinP
Novice
Posts: 7
Liked: 1 time
Joined: Apr 16, 2020 6:02 pm
Full Name: Justin Pauls
Contact:

looking for a V10A / V11 script to output Backup job elements in column/csv output

Post by JustinP »

Our enterprise environment is fairly large (3000+ protected guests across many ESX clusters), and with the job details not being available as expandable columns in the UI (eg: looking for all jobs that have GFS turned on, or CBT, etc are not available) the only option is to develop a script.

I've been looking through the forums here, and I honestly see more 2012/2015 activity on this topic - and having come from a v9 install and knowing the PS commands have matured - I figured I'd ask to see if someone has a straight table dump of all job properties that I can use to feed into a drift report.

VeeamOne's (v11) reporting does not offer this in an accessible way (we're currently piloting it, and due to some limitations with the current SQL server, the SSRS isn't available right now for me to see if the CSV option works).
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: looking for a V10A / V11 script to output Backup job elements in column/csv output

Post by oleg.feoktistov »

Hi Justin,

Just to clarify - are you looking for a way to collect just job property names via powershell with the corresponding types they hold? Or a way to get all properties' values for particular jobs, which would correspond to what you see in the UI when you click through a Job Wizard?

Thanks,
Oleg
JustinP
Novice
Posts: 7
Liked: 1 time
Joined: Apr 16, 2020 6:02 pm
Full Name: Justin Pauls
Contact:

Re: looking for a V10A / V11 script to output Backup job elements in column/csv output

Post by JustinP »

Good morning Oleg! :)

Initially I'm looking to collect all settings of a particular Daily backup jobs - we have dozens of jobs covering many clusters (by design for our needs) but being able to track changes to the jobs, and looking for discrepancies is "unpleasant".
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: looking for a V10A / V11 script to output Backup job elements in column/csv output

Post by soncscy »

Hey Justin,

Have you checked the output of Get-VBRJobOptions?

I only have pseudocode here, but a few things:

- There are a LOT of job options
- Probably you don't care about 95% of them
- Probably you want to make a PS Custom Object with relevant concerns from a CJobOptions object

So if it were me, I'd make some function like:

Code: Select all

function Get-RelevantVeeamJobOptionsFromJob {
     param(
              [Veeam.Backup.Core.CBackupJob[]]$VBRJob
              )
     $jOptions = Get-VBRJobOptions -Job $VBRJob
     $RelevantJobOptions = "" | select nameone, nametwo, namethree, etc
     $RelevantJobOptions.nameone = $jOptions.someproperty
     $RelevantJobOptions.nametwo = $jOptions.someproperty
     ....
     return $RelevantJobOptions
 }
I'd run this function on each job from a jobs array and compare the returned output against some $DefaultJobOptions and just return any that does not match the default.

I'd play with that and see what you find, and you can output the results to CSV easily by piping it to Export-CSV.
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests