PowerShell script exchange
Post Reply
manuel.aigner
Enthusiast
Posts: 35
Liked: 5 times
Joined: Sep 25, 2017 8:25 am
Full Name: Manuel Aigner
Contact:

Get-VBRApplicationRestorePoint and how to get parent job

Post by manuel.aigner »

Hi there,

is there a possibility to get the parent backup job by restore point id?

I have following problem:

I need a script to automatically restore a database from production system to a QA or Test server. Therefore before I can start I must find a proper restore point in productive backup.

Code: Select all

$Bkups = Get-VBRApplicationRestorePoint  -Name "icdbc01q"
Here I get as expected all available RPs from this machine

now do some filter actions to get a RP from e.g. 1 day old backup

Code: Select all

$Bkups | where {$_.CreationTime -ge (get-date).AddDays(-1) -and ($_.CreationTime -le (get-date).AddDays(0))}
but now I get completely equal records as result (excepting the IDs)

Code: Select all

IsExchange        : False
IsActiveDirectory : False
IsSharePoint      : False
IsSQL             : True
IsOracle          : False
CreationTime      : 16.04.2018 18:06:53
Type              : Increment
IsIndexed         : False
IsCorrupted       : False
Name              : ISDBC01Q
Id                : d590c96c-f05f-44ef-9d47-06058c2d6400

IsExchange        : False
IsActiveDirectory : False
IsSharePoint      : False
IsSQL             : True
IsOracle          : False
CreationTime      : 16.04.2018 18:06:53
Type              : Increment
IsIndexed         : False
IsCorrupted       : False
Name              : ISDBC01Q
Id                : 4f8b4057-0ddf-43e8-8d76-d79f259b6949
I think this happens because we're using Backup-Copy Jobs.

Because of the fact this two RPs are located on two different Datacenters it's a latency and throughput thing I want to choose the RP which is nearest to my restore location.
But with resulting data it seems impossible to me to figure out which RP is Backup and which is Backup-Copy

Does anyone have any ideas?
tsightler
VP, Product Management
Posts: 6035
Liked: 2860 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Get-VBRApplicationRestorePoint and how to get parent job

Post by tsightler » 1 person likes this post

The "Id" property should be the id of the parent restore point, so you can use Get-VBRRestorePoint to determine which point is in what repository and/or what job.

It might be easier to start the other way, i.e. start with the restore point itself. For example, to get the most recent point I usually use something like:

Code: Select all

$rp = Get-VBRRestorePoint -Backup "<backup_name>" -Name "<server_name>" | Sort-Object –Property CreationTime –Descending | Select -First 1
$arp = Get-VBRApplicationRestorePoint -Id $rp.Id
The first command gets me the most recent restore point for the VM that I want, from the specific backup that I want, and then I get the application restore point for that restore point Id.
manuel.aigner
Enthusiast
Posts: 35
Liked: 5 times
Joined: Sep 25, 2017 8:25 am
Full Name: Manuel Aigner
Contact:

Re: Get-VBRApplicationRestorePoint and how to get parent job

Post by manuel.aigner »

Hi Tom,

that was my missing link :)
Perfectly ... works!
ru6en
Veeam Software
Posts: 1
Liked: never
Joined: Sep 12, 2017 3:06 pm
Full Name: Ruben Cirjan
Contact:

Re: Get-VBRApplicationRestorePoint and how to get parent job

Post by ru6en »

Hi,

To avoid any issues that might arise when the latest restore point from the backup job doesn't contain a valid Application restore point (Application Aware fails but we still have an image level backup), it is advisable to apply the filter in the second line like:

Code: Select all

$rp = Get-VBRRestorePoint -Backup "<backup_name>" -Name "<server_name>" 
$arp = Get-VBRApplicationRestorePoint -Id $rp.Id | Sort-Object –Property CreationTime –Descending | Select -First 1
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests