PowerShell script exchange
Post Reply
Gunnersaurus
Service Provider
Posts: 69
Liked: 6 times
Joined: Aug 31, 2015 8:20 pm
Contact:

Get-VBRBackup using id parameter

Post by Gunnersaurus » 1 person likes this post

Hi,

I am trying to use the Get-VBRBackup command with the use of the "Id" parameter to get restore info from the supplied job id but not having much success.

The online documentation suggests: "Specifies an array of the job IDs. The cmdlet will return backups created with these jobs." I have tried to supply several backup job id's in GUID format (without quotes) for jobs with valid restore points however I don't get any results returned. For example, "Get-VBRBackup -id 4914c0c9-9914-43a2-8952-3ca93a86cc4c"

If I run Get-VBRBackup without any parameters, I can see a row from the returned results where the id above shows up under the field "JobId". That row also has a field named "id" which has another GUID value. If I use that "id" value with the "Get-VBRBackup -id" command, I do in fact get a returned result which has a job name that matches the initial job id I specified right at the beginning.

The problem here though is that this appears to be mapping restore points to jobs id's. It does seem a bit confusing that the parameter is working in this way as from my interpretation of the documentation, it should be the other way around. I have tried the "Name" parameter which doesn't seem to have this issue and works as intended however I would rather work with job id's as this guarantees uniqueness amongst jobs.

It would be great to get some clarification on this and whether it is at all possible to map job id's to restore points.
david.domask
Veeam Software
Posts: 1246
Liked: 326 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRBackup using id parameter

Post by david.domask »

Heya @Gunnersaurus

The -ID flag is for backup_ID, and looks like you're feeding it a Job_ID.

Code: Select all

PS C:\Users\Administrator> $backup | select id, name, jobID

Id                                   Name             JobId
--                                   ----             -----
e3b8689e-b256-4f23-890b-f20922b94163 vmware-pervm-ffi 5084f1b9-6c0e-435d-ba1e-31312b29333a


PS C:\Users\Administrator> $job | select id, name

Id                                   Name
--                                   ----
5084f1b9-6c0e-435d-ba1e-31312b29333a vmware-pervm-ffi
You can that the ID for job and JobID are the same, it's how the backup gets tied to a job. What you need instead is the first ID returned, which is the backup's ID.

JobID can be used by doing:

Code: Select all

Get-VBRBackup | Where-Object {$_.JobID -eq 'UUID of job'}
Make sense? There are other use cases for using the backup ID to fetch backup data besides general searches, so it might not seem intuitive at first, but it does have purposes; just not in this case :)
David Domask | Product Management: Principal Analyst
Gunnersaurus
Service Provider
Posts: 69
Liked: 6 times
Joined: Aug 31, 2015 8:20 pm
Contact:

Re: Get-VBRBackup using id parameter

Post by Gunnersaurus »

Hi David,

Thanks for the detailed explanation, this makes perfect sense now! :D
david.domask
Veeam Software
Posts: 1246
Liked: 326 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRBackup using id parameter

Post by david.domask »

Always welcome, good luck!

I can see this looks like it's just a documentation error, as the example even uses backup_id, and assuming I read the backend right, it looks like it uses backup ID also.

I've asked the Tech Writers to please investigate and update if the information is correct or if I'm mistaken.
David Domask | Product Management: Principal Analyst
david.domask
Veeam Software
Posts: 1246
Liked: 326 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRBackup using id parameter

Post by david.domask »

Tech Writers confirmed it was a small documentation mistake and updated the User Guide.

Thanks for reporting it @Gunnersaurus!
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 4 guests