How do I generate a report that list only size of the last Full backup in the following format, doesnt need to be in this exact order but contains at least these below
Object Name Job Name Job Type Date/Time Duration Backup Server Total Backup Size
I need to know when the last full backup was done for each object (VM, Computer and so on) how long it took, the actual amount it backed up without compression or deduplication and which backup job the object is located in
Thanks
-
- Lurker
- Posts: 1
- Liked: never
- Joined: Dec 15, 2023 3:02 pm
- Full Name: Geoff Rennie
- Contact:
-
- Veeam Software
- Posts: 2021
- Liked: 673 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: Report for Last Full Backup
Hi,
Try this code:
As for backup server info, you can fetch it with the cmdlet below:
Best regards,
Oleg
Try this code:
Code: Select all
$restorePoints = Get-VBRRestorePoint | Where-Object { $_.Type -eq "Full" } | Sort-Object -Property CreationTime -Descending
$lastFullBackups = $restorePoints | Group-Object -Property { $_.Name } | ForEach-Object { $_.Group | Select-Object -First 1 }
$jobs = Get-VBRJob
$fullBackupInfo = @()
foreach ($backup in $lastFullBackups) {
$duration = $null
$transferedSize = $null
$storage = $backup.GetStorage()
$backupSize = [Math]::Round($storage.Stats.BackupSize/1GB, 2)
$job = $jobs | Where-Object { $_.GetObjectsInJob().ObjectId -eq $backup.ObjectId -and $backup.GetBackup().JobId -eq $_.Id }
$session = Get-VBRBackupSession -Id $backup.JobRunId -ErrorAction SilentlyContinue
if ($session) {
$taskSession = $session.GetTaskSessions() | where {$_.ObjectId -eq $backup.ObjectId}
$duration = $taskSession.Progress.Duration.ToString()
$transferedSize = [Math]::Round($taskSession.Progress.TransferedSize/1GB, 2)
}
$fullBackupInfo += $backup | select @{n="Object Name";e={$backup.Name}}, `
@{n="Creation Time";e={$backup.CreationTime}}, `
@{n="Job Name";e={$job.Name}}, `
@{n="Job Type";e={$job.TypeToString}}, `
@{n="Duration";e={$duration}}, `
@{n="Transfered Size GB";e={$transferedSize}}, `
@{n="Backup Size GB";e={$backupSize}}
}
$fullBackupInfo
Code: Select all
Get-VBRBackupServerInfo
Oleg
Who is online
Users browsing this forum: No registered users and 11 guests