PowerShell script exchange
Post Reply
Posts: 1
Liked: never
Joined: Apr 17, 2019 5:16 pm
Full Name: Jared Maurina

Cannot Find Local Backup of a Veeam Agent with Powershell

Post by jmaurina » Apr 17, 2019 5:35 pm

We are attempting to script out our test environment restore process. Our environment is backed up locally and also to Azure. This process consists of us restoring 15 VMs, 2 of which back up using the Veeam Agent. The working Powershell snip we are using is this.

Code: Select all

    $RestorePoint = Get-VBRRestorePoint -Name $VMName | Sort-Object -Property CreationTime -Descending | Select-Object -First 1
    $RestoreHost = Get-VBRServer -Type HvServer -Name $TestHostname
    Start-VBRHvRestoreVM -RestorePoint $RestorePoint -Server $RestoreHost -VMName $RestoredVMName -Path C:\VMs\$RestoredVMName -PreserveVmID $true
I left out a part where I only select those who use a certain BackupID, as I don't want it pulling from Azure.

When we run

Code: Select all

Get-VBRBackup | Select Name | Sort-Object Name -Descending
I get this in return (I have blocked out part of the name for privacy).

Code: Select all

Offsite - Priority 2 - Windows Vms           
Offsite - Priority 2 - Linux VMs             
Offsite - Priority 1 - Windows VMs           
Offsite - Priority 1 - Linux VMs             
Offsite - Agent Priority 1 - Windows VMs     
Offsite - Agent Priority 1 - MSExchange     
Local - Priority 2 - Windows VMs             
Local - Priority 2 - Linux VMs               
Local - Priority 1 - Windows VMs             
Local - Priority 1 - Linux VMs  
There should be 3 additional Local ones for the Agents. These show up in the UI under Jobs and Backups.

I do not want to pull these from Azure, to cut down on data usage.

Since I can't find a local backup, I can't proceed and use

Code: Select all


Code: Select all

Any help to make my life easier is greatly appreciated.

Veeam Software
Posts: 2772
Liked: 579 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen

Re: Cannot Find Local Backup of a Veeam Agent with Powershell

Post by nielsengelen » Apr 19, 2019 9:08 pm

Get-VBRBackup only returns VM's. This is why you don't see the agent jobs. There is a workaround for this available in the following thread.

Also, restoring agent backup should be done via Start-VBREpInstantRecovery.
Veeam Certified Architect (VMCA)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests