PowerShell script exchange
-
zveky
- Lurker
- Posts: 1
- Liked: never
- Joined: Nov 08, 2024 3:07 am
-
Contact:
Post
by zveky »
this post
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:
Post
by david.domask »
this post
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
Users browsing this forum: No registered users and 2 guests