The most important thing to remember
Configuration : Job -> Job Runs : BackupSession -> Result : Backup
Session
Session naming might be confusing. They are called
Session is the job runn -> Individual VM are tasks
Getting the sessions; It is always a good idea to cache $sessions and then use a local filter
$sessions = Get-VBRBackupSession
$sessions | ? { $_.name -match "^$backupjobname \(" }
It might be useful to use ID if jobs are renamed and less bad matches
$backupjobname = "Backup Job 1"
$job = get-vbrjob -name $backupjobname
$sessions = Get-VBRBackupSession
$sessions | ? { $_.jobid -match $job.id }
Get The latest session via the job
$backupjobname = "Backup Job 1"
$job = get-vbrjob -name $backupjobname
$lastsession = $job.FindLastSession()
Interesting parts of the session
$lastsession.Progress # transferred data, backup size, duration
$lastsession.Progress.BottleneckInfo # bottleneck info
$lastsession.BackupStats # contain dedupe and compression ratio
$lastsession.logger.getlog().GetRecordsSortedByOrdinalId() | select title # text in window
Getting the task sessions
$tasksession = $lastsession | Get-VBRTaskSession
#or not supported
$lastsession.GetTaskSessions()
$tasksession.progress # transferred data, backup size, duration
$tasksession.progress.bottleneckinfo # bottleneck info
$tasksession.logger.getlog().GetRecordsSortedByOrdinalId() | select title # text in window
Interestings parts of the task session
$tasksession.progress
Backup
Backups Consist Of -> Objects (VM) (Veeam.Backup.Core.CHierarchyObj) -> VM Restore Points (VM + Date) (Veeam.Backup.Model.COibInfo or Object in backup) -> Storages (Backup Files) (Veeam.Backup.Model.CStorageInfo) -> Storages connect to Restore Points (VM + Date) (Veeam.Backup.Model.COibInfo) (GetOibs()) -> Points (they have the runtime info but are not the files themselves, nor the VMs) (Veeam.Backup.Model.CPointInfo) -> Points connect to Restore Points (VM + Date) (Veeam.Backup.Model.COibInfo) (GetOibs())
Get Backup
$backupjobname = "Backup Job 1"
Get-VBRBackup -Name $backupjobname
You can also start from the backup job itself
$backupjobname = "Backup Job 1"
$job = get-vbrjob -name $backupjobname
$job.FindLastBackup()
Get all VM Restore points connected to a backup
$backupjobname = "Backup Job 1"
Get-VBRBackup -Name $backupjobname | Get-VBRRestorePoint
Getting the backup files
$backupjobname = "Backup Job 1"
$backups = Get-VBRBackup -Name $backupjobname
$storages = $backups.GetAllStorages()
Interesting stats for storages
$backupjobname = "Backup Job 1"
$backups = Get-VBRBackup -Name $backupjobname
$storages = $backups.GetAllStorages()
$storage = $storages[0]
$storage.Stats #data stats on disk
Getting all the points $backups.GetPoints()
$backupjobname = "Backup Job 1"
$backups = Get-VBRBackup -Name $backupjobname
$backups.GetPoints()
Getting the latest backup point
$backupjobname = "Backup Job 1"
$backups = Get-VBRBackup -Name $backupjobname
$point = $backups.GetLastPoint()
Getting the latest vm rest points
$backupjobname = "Backup Job 1"
$backups = Get-VBRBackup -Name $backupjobname
#the quick way
$point = $backups.GetLastPoint()
$point.GetOibs()
#or directly
$backups.GetLastOibs()
Getting the VM Names
$backupjobname = "Backup Job 1"
$backups = Get-VBRBackup -Name $backupjobname
$backups.GetObjects() | select id,name
#you can compare this
Get-VBRRestorePoint | select name,objectid