Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 9995

PowerShell • Re: Request for PowerShell Command to Retrieve VM Backup Details in Veeam

$
0
0
Hi Asif,

A simple example of such script would look like that:

Code:

$backups = Get-VBRBackupforeach ($backup in $backups) {  $storages = $backup.GetAllChildrenStorages()  foreach ($storage in $storages) {    $rp = $storage.GetOibs()    $originalSize = [Math]::Round($rp.ApproxSize/1GB, 2)    $backupSize = [Math]::Round($storage.Stats.BackupSize/1GB, 2)    $rp | select Name, @{n='OriginalSize';e={$originalSize}}, @{n='FileName';e={$storage.PartialPath}}, `    @{n='CreationTime';e={$storage.CreationTime}}, @{n='BackupSize';e={$backupSize}}  }}
Then, you can filter the data out by the relevant date you need:

Code:

$currentDate = Get-Date$rp | select Name, @{n='OriginalSize';e={$originalSize}}, @{n='FileName';e={$storage.PartialPath}}, `@{n='CreationTime';e={$storage.CreationTime}}, @{n='BackupSize';e={$backupSize}} | `where {$storage.CreationTime -ge $currentDate.AddMonths(-1) }
Best regards,
Oleg

Statistics: Posted by oleg.feoktistov — Dec 04, 2023 11:52 pm



Viewing all articles
Browse latest Browse all 9995

Latest Images

Trending Articles



Latest Images