PowerShell script exchange
Post Reply
GianlucaCroci
Expert
Posts: 236
Liked: 23 times
Joined: Feb 26, 2019 12:08 pm
Full Name: Gianluca Croci
Contact:

Reports of

Post by GianlucaCroci »

Hello,
we're "migrating" all the copyjobs from a standard repository to a S3.
To do this, we've to change all jobs because the blocksize is 512 instead 1024, and after this modif we've to do a full backup.

To manage better the "transition" we'd like a list of all the backup jobs with some parameters:
- job name
- type job (Backup, Backup Copy, File Backup, File Copy)
- Description
- Backup Repository
- Retention policy
- if configured a secondary destination, the name of the job (or jobs)
- when the actif full (if activated)
- when the synthetic full (if activated)
- compression level
- storage optimization
- enabled Vmware tools quiescence (yes/no)
- when next run

A list of all Servers:
- name of the server (VM or Physical)
- name of the backup job
- Backup Size (GB) last full
- Backup Size (GB) total (all the full + all the incr)
- how many restore points
- last backup date

A list of all Copy Jobs:
- name of the copy job
- Description
- Backup Repository
- Retention policy
- if activated the "keep certain full backup longer..."
- compression level
- last execution

I'll bring all this CSV lists and I'll merge them on Excel.

We've serveral type of backup jobs:
- IBM AIX Agent
- Linux Agent
- Windows Agent
- WMware Backup
- File Backup

Furthermore, they aren't all daily but we've some saves only on the weekend (Saturday or Sunday) and others only on the last day of the month.
Therefore, if I run the report today, it will also show me the monthlies for the end of May.

Thanks for your help !
Regards
david.domask
Veeam Software
Posts: 2334
Liked: 554 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Reports of

Post by david.domask »

Hi GianlucaCroci,

This is a pretty involved report/script request, can I ask, do you have a start on this already and need assistance or you're hoping someone has something already?

First, I'd suggest check the following VeeamOne reports, as I think these have all the elements you're looking for and you can just filter out unnecessary entries later on:

Job Configuration Dump: https://helpcenter.veeam.com/docs/one/r ... ml?ver=120
Protected VMs report: https://helpcenter.veeam.com/docs/one/r ... ml?ver=120


This will cover most of what you're looking for and if you're going to be merging the data in anyways, this might just be the better option than trying to write a script.

If you want to build a script on this, you'd need to do a few things using cmdlets from this list (search the list for the respective cmdlet pages):

https://helpcenter.veeam.com/docs/backu ... ml?ver=120

Get-VBRJob => Get job details, will pass the resulting objects further down.
Get-VBRJobOptions => Pass a CJob object from Get-VBRJob to this to get the configuration options like retention, repository, etc. These do exist on the CJob objects, but they're a bit buried in properties so might be easier to go through this one.
Get-VBRJobScheduleOptions => Return schedule data for the CJob object passed to this cmdlet.
Get-VBRBackup => Will get you the backups, we need to pass this to Get-VBRRestorePoint to get information on last restore point
Get-VBRRestorePoint => Information on all restore points that exist -- sort on CreationTime property with -Descending flag so the first restore point returned is always the newest

I would advise create a basic workflow based off of Get-VBRJob, then loop over each job and:

1. Save the JobOptions from Get-VBRJobOptions to some variable
2. Get the Backups, pass those to Get-VBRRestorepoint
3. You'll need to loop-over all the Restore Points and find
3a. Each VM's backup chain (use the ObjectID to distinguish the machines in the jobs from one another)
3b. The most recent restore point from each backup chain (sort on CreationTime as mentioned above with -Descending flag)
4. Get the rest of the information you're looking from from the Job object, JobOptions object, and the restore point data
5. Compile it all together and then export it to CSV using Export-CSV native powershell cmdlet.

I know that seems like a lot, which is why I'm recommending the VeeamOne reports and consider filtering those out.

If you go the script route, give it a shot with just buliding the workflow to pull the necessary data out of _one_ job, then once you have that working successfully, loop over all the jobs returned by Get-VBRJob and see what works and what needs to be fixed.

Share your script here if you go that route and encounter some difficulties.
David Domask | Product Management: Principal Analyst
GianlucaCroci
Expert
Posts: 236
Liked: 23 times
Joined: Feb 26, 2019 12:08 pm
Full Name: Gianluca Croci
Contact:

Re: Reports of

Post by GianlucaCroci »

Hello David,
thx a lot for your reply.

We've Veeam One but the communty edition, because too much expensive for the number of server that we've.
But I'd like it :-)

Not so able to do complex powershell scripts.
can you write me, please, the points 1 to 5 in a form that I just have to execute.
I tried to create one, but after a few hours of trials and failures...

Thanks again
Regards
david.domask
Veeam Software
Posts: 2334
Liked: 554 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Reports of

Post by david.domask »

Hi Gianluca,

Got it, I would advise consider discussing with your Veeam Sales Representative as maybe there is something that can be done with regards to VeeamOne and your licensing, as it seems like it'd handle a lot of what you need.

Regarding the script, perhaps you can share what you came up with and had difficulties with? Regrettably this is a fairly involved script and has some pretty specific formatting requirements as I see it, so I think it would be best you show what you tried first and we can help guide you on the parts that leave you with questions. I don't have any pre-made scripts that reflect all that data, so I think it's best we just help you over the challenges.

Similarly, doesn't the MyVeeamReport.ps1 script cover a lot of this for you? There's a fairly active topic and I think maybe you can consider this for your reporting needs.

Else, show us what you were trying so far and we can try to help with the challenges.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests