PowerShell script exchange
Post Reply
Yuya
Enthusiast
Posts: 82
Liked: 2 times
Joined: Jan 30, 2013 9:32 am
Contact:

No results are displayed when using Get-VBRRestorePoint cmdlet for backup copy job

Post by Yuya »

Hello,

I used the Get-VBRRestorePoint cmdlet for a backup copy job.
But I don't see the restore points.
For backup jobs, the restore points are displayed.
Am I using the cmdlet incorrectly?
https://helpcenter.veeam.com/docs/backu ... ml?ver=100

$backup = Get-VBRBackup -Name "Backup Copy Job 1"
Get-VBRRestorePoint -Backup $backup

Regards,
Yuya
HannesK
Product Manager
Posts: 14840
Liked: 3086 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: No results are displayed when using Get-VBRRestorePoint cmdlet for backup copy job

Post by HannesK »

Hello,
hmm, I have seen exactly the same question with more or less the same code sniplet from one of my Japanese colleagues... if we are talking about the same thing, would be be possible that you talk to your Veeam SE? Then we don't need to repeat everything here :-)

The code pasted above works fine. I assume that you did not paste the full code (I'm just guessing because of the internal post from yesterday)

If you are using backup copy job mirror mode, then please check this post post371374.html#p371374

Best regards,
Hannes
Yuya
Enthusiast
Posts: 82
Liked: 2 times
Joined: Jan 30, 2013 9:32 am
Contact:

Re: No results are displayed when using Get-VBRRestorePoint cmdlet for backup copy job

Post by Yuya »

Thanks Hannes,

The backup copy job was in mirroring mode.
For the backup copy job in pruning mode, the restore point was displayed with the following command.
$backup = Get-VBRBackup -Name "Backup Copy Job 1"
Get-VBRRestorePoint -Backup $backup

The backup copy job in mirroring mode also displayed the restore point with the following command.
$backup = Get-VBRBackup | where {$_.JobType -eq 'SimpleBackupCopyWorker'}

But I have multiple backup copy jobs.
How should I select a specific backup copy job?

Kind Regards,
Yuya
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: No results are displayed when using Get-VBRRestorePoint cmdlet for backup copy job

Post by oleg.feoktistov »

@Yuya, just combine 2 filters - Name and JobType:

Code: Select all

$backup = Get-VBRBackup -Name "Backup Copy*" | where {$_.JobType -eq 'SimpleBackupCopyWorker'}
Thanks!
soncscy
Veteran
Posts: 643
Liked: 312 times
Joined: Aug 04, 2019 2:57 pm
Full Name: Harvey
Contact:

Re: No results are displayed when using Get-VBRRestorePoint cmdlet for backup copy job

Post by soncscy »

I'm not sure, but I think Yuya is talking about if you use

Code: Select all

where {$_.JobType -eq 'SimpleBackupCopyWorker'}
to retrieve the Immediate Mode copies, right?

And for that you'd need to either pipe the result down further or add another comparison operation with

Code: Select all

-and $_.Name -like 'name of the backup copy*'
I've noticed that the immediate copy names have some path-like structure to them, but the first field is always the 'parent' name (is that the right term? what is the term for the relationship between the actual immediate copy and these workers?)

Am I missing something Oleg that your line works?
Yuya
Enthusiast
Posts: 82
Liked: 2 times
Joined: Jan 30, 2013 9:32 am
Contact:

Re: No results are displayed when using Get-VBRRestorePoint cmdlet for backup copy job

Post by Yuya »

Hello,

I ran the following command:
$backup = Get-VBRBackup -Name "name of Backup Copy Job" | where {$_.JobType -eq 'SimpleBackupCopyWorker'}
Or
$backup = Get-VBRBackup | where {$_.JobType -eq 'SimpleBackupCopyWorker' -and $_.Name -like 'name of Backup Copy Job'}

However, when I run the following command, I get an error because $backup is Null.

Code: Select all

PS C:\Users\Administrator> Get-VBRRestorePoint -Backup $backup
Get-VBRRestorePoint: Unable to see the argument for parameter'Backup'. The argument is null. Command with a valid value for the argument
Please try again.
Location Line: 1 Character: 29
+ Get-VBRRestorePoint -Backup $backup
+                             ~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-VBRRestorePoint]、ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Cmdlets.GetVBRRestorePoint
Kind Regards,
Yuya
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: No results are displayed when using Get-VBRRestorePoint cmdlet for backup copy job

Post by oleg.feoktistov »

Hi all,

Apologies, I forgot to mention that a wildcard symbol is needed in the end of a job name:

Code: Select all

-Name "Backup Copy*" | where {$_.JobType -eq 'SimpleBackupCopyWorker'}
Or an explicit call:

Code: Select all

-Name "Backup Copy Job\Source Backup Job" | where {$_.JobType -eq 'SimpleBackupCopyWorker'}
@soncscy, it's either that or a pipe you mentioned.
I've noticed that the immediate copy names have some path-like structure to them, but the first field is always the 'parent' name
Naming is in the format Backup Copy Job\Source Backup Job
What is the term for the relationship between the actual immediate copy and these workers?
I explained it in this post.

Hope it helps,
Oleg
Yuya
Enthusiast
Posts: 82
Liked: 2 times
Joined: Jan 30, 2013 9:32 am
Contact:

Re: No results are displayed when using Get-VBRRestorePoint cmdlet for backup copy job

Post by Yuya »

Thank you for the advice!
I was able to confirm that the expected result was obtained.

Kind Regards,
Yuya
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests