Script to show last successful Veeam backup of VMs
Here is a small and simple PowerShell script to list VMs, their last successful backup and the days gone since then.
Add-PSSnapin VeeamPSSnapin
Connect-VBRServer -Server Backup_Server
$today = Get-Date
$vbrrestore = get-vbrbackup | Get-VBRRestorePoint | sort vmname,CreationTime | select vmname, creationtime , @{n='Days since last success'; e={(New-TimeSpan -Start $_.creationtime -End $today).days}} | group vmname
$vbrrestore | foreach {$_.group | select -last 1} | ft -AutoSize
Please could you help me. Do you know how to filter this to get only Veeam Agent backup jobs for Windows computers? Thanks
I didn’t need this up to now. But you can filter by Job-Name in cmdlet get-vbrbackup, or you can probably use Get-VBREPJob instead, that should be for agent-backup only.
One more question please : How to exclude computer/vm included in disabled jobs? Thanks for your help
I didn’t need this too. I am quite sure, get-vbrbackup returns state of job (enabled/disabled) to filter for this state.
Are you alive?
Yes, I am. Thanks for asking.
Ah ok, I didn’t have answer so I was afraid that something appened to you 😉
Thanks for your answers
I don’t think this distinguish between successful and incomplete restore points, so the result could be misleading. All of them are returned by Get-VBRRestorePoint. There are properties IsCorrupted and IsConsistent on the snapshot that seem to be related do this. I don’t know the difference between them – perhaps one is just the inverse of the other for convenience.
Good point, Oskar! Script is quite old (2017), so I do not know what was possible than. But you are right, would be a good idea to query this properties as well!