Get all used backup repositories of a backup job

PowerShell script exchange

Get all used backup repositories of a backup job

Veeam Logoby edirschedl » Wed Aug 09, 2017 8:46 am

Hi,

we have some big scale-out repositories with a lot of extends.
With help of a script, I want to get all used extends of a single backup job. So for example I've a job called "Backup 1" and it has backup files on "Extend 1", "Extend 2" and "Extend 3" in a Scale-Out-Repo with 10 extends total.
How do I get this information on which extends there are backup files of this specific backup job - with help of a powershell script?


Thank you for your tips / advices.

Emanuel
edirschedl
Influencer
 
Posts: 21
Liked: 2 times
Joined: Thu Jul 21, 2016 12:29 pm

Re: Get all used backup repositories of a backup job

Veeam Logoby v.Eremin » Wed Aug 09, 2017 5:38 pm

Backup object (Get-VBRBackup) contains identifier of repository it resides on ($Backup.info.RepositoryId).

If my assumption is correct and this property provides identifier of extent, not of Scale-Out Backup Repository as a whole, you should be able to find needed extent, using it. (VBRRepositoryExtent)
v.Eremin
Veeam Software
 
Posts: 13433
Liked: 987 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get all used backup repositories of a backup job

Veeam Logoby edirschedl » Fri Aug 11, 2017 5:45 am

Sadly RepositoryID is the same ID as the Scale-Repo itself (or ParentID from the single extents). So that's no information to get the specific extents where the backup files are located.
edirschedl
Influencer
 
Posts: 21
Liked: 2 times
Joined: Thu Jul 21, 2016 12:29 pm

Re: Get all used backup repositories of a backup job

Veeam Logoby v.Eremin » Fri Aug 11, 2017 4:20 pm 1 person likes this post

I do not have a good lab at hand to test the script, but at least it should give you the right directions:

Code: Select all
Asnp VeeamPssnapin
$Backup = (Get-VBRBackup | where {$_.Jobname -eq "Name of job pointed to SOBR"})
$Backup.GetOibs() | select name, {$_.FindChainRepositories().name}

Thanks.
v.Eremin
Veeam Software
 
Posts: 13433
Liked: 987 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get all used backup repositories of a backup job

Veeam Logoby edirschedl » Tue Aug 29, 2017 8:15 am

Thank you very much! It works without problems now.
edirschedl
Influencer
 
Posts: 21
Liked: 2 times
Joined: Thu Jul 21, 2016 12:29 pm

Re: Get all used backup repositories of a backup job

Veeam Logoby v.Eremin » Tue Aug 29, 2017 10:31 am

You're welcome, if you want to get more smooth output, you can enhance the script further:

Code: Select all
Asnp VeeamPssnapin
$Backup = (Get-VBRBackup | where {$_.Jobname -eq "Name of job pointed to SOBR"})
$Backup.GetOibs() | select @{N="Name";E={$_.Name}}, @{N="Repository Name";E={$_.FindChainRepositories().name}} | ft -AutoSize

Anyway, glad to hear my input was helpful. Let us know, should other questions arise.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13433
Liked: 987 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

[MERGED] Get all used backup repositories of a backup job

Veeam Logoby keith.sng » Sun Sep 03, 2017 9:28 am

Dear all,

Would like to know if someone can advise on how to generate out all the Backup Jobs listing within a Scale-Out Backup Repository using Powershell Scripts?

As this can be seen via the GUI but a customer is performing some migration and powershell output will be a much easier way to view ...

default scripts of:
Get-VBRRepositoryExtent -Repository "Name of Scale-Out" only returns the extents

Thanks in advance...
keith.sng
Veeam Software
 
Posts: 7
Liked: never
Joined: Mon Jan 16, 2017 8:47 am
Full Name: Keith Sng Chee Keong

Re: Get all used backup repositories of a backup job

Veeam Logoby v.Eremin » Mon Sep 04, 2017 1:00 pm

Using script above, you can get all backups stored on particular SOBR along with names of extents those backups reside on. Is that something you're looking for?
v.Eremin
Veeam Software
 
Posts: 13433
Liked: 987 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get all used backup repositories of a backup job

Veeam Logoby keith.sng » Thu Sep 07, 2017 4:40 am

Hi,

For this, we have to specify the Backup Job Name which is rather tedious as our customer has a quite a large number of Jobs in place.

Ray has assisted and contributed to the following scripts..

CODE: SELECT ALL
$Backup = (Get-VBRBackup | where {$_.Jobname -like "*"})
Foreach($Backup in $Backup) {
$Job = Get-VBRJob -name $Backup.JobName
$Backup.GetOibs() | select name, {$_.FindChainRepositories().name}, {$Backup.JobName},{(Get-VBRBackupRepository -ScaleOut | Where {$_.Id -eq $Job.Info.TargetRepositoryId}).Name}
}
keith.sng
Veeam Software
 
Posts: 7
Liked: never
Joined: Mon Jan 16, 2017 8:47 am
Full Name: Keith Sng Chee Keong


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 7 guests