PowerShell script exchange
Post Reply
zveky
Lurker
Posts: 1
Liked: never
Joined: Nov 08, 2024 3:07 am
Contact:

get provisioned and used size

Post by zveky »

how to get provisioned and used size from backup.
https://we.tl/t-E1dWooD1od

I have found that provisioned size is ApproxSize but not sure for used size.

Code: Select all

$backup = Get-VBRBackup -Name 'backup-name'
$rps = Get-VBRRestorePoint -Backup $backup | Where-Object {$_.Type -eq "Full"}

$vmDetails = @()

foreach ($rp in $rps) {
    $vmName = $rp.VMName
    $approxSize = [Math]::Round($rp.ApproxSize / 1GB, 2)

    $vmDetails += [PSCustomObject]@{
        VMName = $vmName
        RestorePointType = $rp.Type
        ApproxSizeGB = $approxSize
    }
    
    Write-Output "VM: ${vmName}, Type: $($rp.Type), Approx Size: ${approxSize} GB"
}

$vmDetails | ForEach-Object { Write-Output $_ }
david.domask
Veeam Software
Posts: 2109
Liked: 509 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: get provisioned and used size

Post by david.domask »

Hi zveky,

Get-VBRRestorePoint returns COib objects, and they have a property AuxData:

Code: Select all

$Backup = Get-VBRBackup -name 'some backup'
$rp = Get-VBRRestorePoint -Backup $Backup
$rp[0].AuxData | select  VmxDsPath, RealVMSize, DisksCapacity

VmxDsPath                            RealVmSize DisksCapacity
---------                            ---------- -------------
dd-sql-randdata/dd-sql-randdata.vmx 34021607276  204010946560
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests