PowerShell script exchange
Post Reply
rajesh.swain
Lurker
Posts: 2
Liked: never
Joined: Jun 14, 2023 5:00 am
Full Name: Rajesh Kumar Swain
Contact:

Alternative for Get-VBRBackupSession.CurrentPointId

Post by rajesh.swain »

In the "Veeam Backup & Replication 11" version, I was using below PowerShell command to find that any backup executed manually (not scheduled) and restore point has been created.

$session=Get-VBRBackupSession | ? {$_.Info.RunManually -ne 'True'}
$backup=Get-VBRBackup | Get-VBRRestorePoint -Name "vm name" | ? {$_.PointId.Guid -in $session.CurrentPointId}


In the "Veeam Backup & Replication 12" version, Get-VBRBackupSession.CurrentPointId is dropped out, so not able to link Get-VBRRestorePoint and Get-VBRBackupSession.
Any idea how to link Get-VBRRestorePoint with Get-VBRBackupSession.
ronnmartin61
Veeam Software
Posts: 583
Liked: 215 times
Joined: Mar 07, 2016 3:55 pm
Full Name: Ronn Martin
Contact:

Re: Alternative for Get-VBRBackupSession.CurrentPointId

Post by ronnmartin61 »

Didn't you mean $_.Info.RunManually -eq true? It's probably not the most efficient way to accomplish this but this should work to get the restore point ID's from manual VM backup job runs -

Code: Select all

$sessions = Get-VBRBackupSession | ? {$_.Info.RunManually -eq 'True'}
foreach ($sesn in $sessions) {
    Get-VBRRestorePoint | Where-Object {$_.JobRunId -eq $sesn.Id } | Select-Object VmName, Id, CreationTime
}
rajesh.swain
Lurker
Posts: 2
Liked: never
Joined: Jun 14, 2023 5:00 am
Full Name: Rajesh Kumar Swain
Contact:

Re: Alternative for Get-VBRBackupSession.CurrentPointId

Post by rajesh.swain »

Thanks ronnmartin61,
I was not able to link between Get-VBRBackupSession and Get-VBRRestorePoint objects.
Got it from your reply that Get-VBRBackupSession.JobRunId = Get-VBRBackupSession.Id.
Its working fine.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests