Hello everyone,
I'm seeking assistance to retrieve detailed backup information for VMs in Veeam, similar to what's visible under the disk job name property in the Veeam console. Specifically, I need a PowerShell command that can pull information about all backed-up VMs for a particular job, including each VM's monthly backup details, such as the date, original size, and backup size.
Could someone guide me on how to achieve this using PowerShell? Any example scripts or pointers to the right Veeam PowerShell cmdlets would be greatly appreciated.
Thanks in advance for your help!
-
- Lurker
- Posts: 1
- Liked: never
- Joined: Jul 31, 2023 3:34 am
- Full Name: Asif Khan
- Contact:
-
- Veeam Software
- Posts: 2021
- Liked: 673 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Request for PowerShell Command to Retrieve VM Backup Details in Veeam
Hi Asif,
A simple example of such script would look like that:
Then, you can filter the data out by the relevant date you need:
Best regards,
Oleg
A simple example of such script would look like that:
Code: Select all
$backups = Get-VBRBackup
foreach ($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}}
}
}
Code: Select all
$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) }
Oleg
Who is online
Users browsing this forum: No registered users and 38 guests