PowerShell script exchange
Post Reply
smace
Novice
Posts: 3
Liked: never
Joined: Mar 20, 2024 9:54 am
Full Name: Macé Steve
Contact:

Feature Request - Recalculate Option Scriptable

Post by smace »

Hello,

For some vm backup inventories or consommation issues, we use script that extract job configuration/consumption but we don't get real size of the backups job because you need to recalculate the job first with your option on the job at the virtual machine tab.

So our graph or analysis are false if we don't do it, so i ask if it's possible to get a script that recalculate all jobs ? Automaticaly each month or manually. Because it's very long to go each job when you have a lot of job and

Regards
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Feature Request - Recalculate Option Scriptable

Post by david.domask »

Hi @smace

I'm not sure I'm following fully; how are you trying to calculate this currently?

You should be able to use Get-VBRJobObjects and pass a CJob object (from Get-VBRJob) to get the current state of all added VMs. For a simple example, I can do this:

Code: Select all

$job = Get-VBRJob -name 'ps-summation-test'
Get-VBRJobObject -Job $job

Name                      Type       ApproxSize       Location
----                      ----       ----------       --------
ddom-debian-backmeup      Include    16 GB            somevc.place.local...
There is slight annoyance in that the ApproxSizeString property has non-integer characters so to sum up the entire job, we need to use a deeper property. I added another VM to the same job so the result looks like this:

Code: Select all

Get-VBRJobObject -Job $job

Name                      Type       ApproxSize       Location
----                      ----       ----------       --------
ddom-debian-backmeup      Include    16 GB           somevc.place.local...
ddom-malware              Include    15.8 GB          somevc.place.local...
And we can sum this with Measure-Object in Powershell by checking the Info property of the CObjectInJob object returned by Get-VBRJobObject.

Code: Select all

$objs = Get-VBRJobObject -Job $job
$objs.Info.ApproxSize | Measure-Object -Sum

Count    : 2
Average  :
Sum      : 34125905920 <=== Total size in bytes
Maximum  :
Minimum  :
Property :
There's no need to manually populate the job, so maybe this will work for you? Or maybe I'm misunderstanding, and if so, can you maybe show your code and the output that is not correct until you click the Populate button?
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests