Solved

How to get a restore job id for the VM using PowerShell command?


Userlevel 1

 

We are not getting restore job Id while running the below PowerShell command in Veeam 11, but for versions below 11, we are getting the restore job id.

I checked the Veeam11 commands document but couldn’t find anything helpful regarding VM restore job id.

Let us know if there is any particular command to fetch the job id.

 

Running command using Veeam11:

$latest_backup_copy = Get-VBRBackup -Name 'backup_job_0'| Get-VBRRestorePoint -Name 'oracle_smallest' | Sort-Object -Property CreationTime -Descending | Select -First 1 ;;  Start-VBRRestoreVM -RestorePoint    $latest_backup_copy -ToOriginalLocation             -StoragePolicyAction Default -PowerUp:$True             -RunAsync

 

Restore Type       VM Name              State      Start Time             End Time               Description

------------       -------              -----      ----------             --------               -----------

RestoreVm          oracle_smallest      Starting   5/28/2021 12:17:24 PM  1/1/1900 12:00:00 AM

 

 

Running  same command using Veeam 10a:

Not sharing the whole output just a snippet with job id

$latest_backup_copy = Get-VBRBackup -Name 'backup_job_0'| Get-VBRRestorePoint -Name 'oracle_smallest' | Sort-Object –Property CreationTime –Descending | Select -First 1 ;;  Start-VBRRestoreVM -RestorePoint   $latest_backup_copy -ToOriginalLocation             -StoragePolicyAction Default -PowerUp:$True             -RunAsync "

 

 

IsCompleted          : False

IsWorking            : False

IsStarting           : True

IsPostprocessing     : False

JobId                : 1c7b60ec-4e8f-43ea-8d69-bb0cb8e1ae44

Result               : None

State                : Starting

EndTime              : 1/1/1900 12:00:00 AM

EndTimeUTC           : 1/1/1900 12:00:00 AM

CreationTime         : 2/10/2021 12:17:01 PM

AuxData              : <AuxData><SessionStarterInfo Version="1" UserName="Administrator" UserDomainName="."

                       RunManually="True" LoginType="4" LoginName="Administrator" /></AuxData>

IsLowerAgentPriority : True

LogName              : oracle_smallest

LogsSubFolder        : oracle_smallest

Logger               : Veeam.Backup.Core.XmlLogger

Tracer               : Veeam.Backup.Core.CSessionLogTracer

icon

Best answer by JMeixner 28 May 2021, 15:42

View original

4 comments

Userlevel 7
Badge +17

Hi,

please try the following:

$latest_backup_copy = Get-VBRBackup -Name 'backup_job_0'| Get-VBRRestorePoint -Name 'oracle_smallest' | Sort-Object -Property CreationTime -Descending | Select -First 1 ;;  

$result = Start-VBRRestoreVM -RestorePoint    $latest_backup_copy -ToOriginalLocation             -StoragePolicyAction Default -PowerUp:$True             -RunAsync

$result.JobId

 

This gives the JobId to you...

Userlevel 7
Badge +17

Another possibility is

Start-VBRRestoreVM -RestorePoint    $latest_backup_copy -ToOriginalLocation             -StoragePolicyAction Default -PowerUp:$True -RunAsync  | Select -property JobId

Userlevel 1

Hi Joe,

Thanks for the quick response and it is working.

Userlevel 7
Badge +17

You are welcome :sunglasses:

Fine that it is working….

Comment