PowerShell script exchange
Post Reply
mmcgough
Lurker
Posts: 2
Liked: never
Joined: Jul 28, 2022 4:16 pm
Full Name: Michael McGough
Contact:

How to find repository in use?

Post by mmcgough »

I have a PowerShell script that I'm trying to use to identify running backup + backup copy jobs and identify which backup repositories are in use by those jobs.
I haven't been able to find a command or combination of commands to show this information, do you know if this is possible?

I can pull the current working jobs but I don't see any link from the running jobs to the location of the job's backup files.
HannesK
Product Manager
Posts: 14322
Liked: 2890 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: How to find repository in use?

Post by HannesK »

Hello,
and welcome to the forums.

Once you have the running jobs Get-VBRjobOptions provides details, such as the job target (repository). So a combination of both should do what you need.

Best regards,
Hannes
mmcgough
Lurker
Posts: 2
Liked: never
Joined: Jul 28, 2022 4:16 pm
Full Name: Michael McGough
Contact:

Re: How to find repository in use?

Post by mmcgough »

I think I'm missing something. I don't see the actual repository mentioned in the output of Get-VBRJobOptions. The closest thing I'm seeing is EpPolicyOptions.TargetShareType returns the repository's type but I don't see any identifiers of the actual repository in use.
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: How to find repository in use?

Post by oleg.feoktistov » 1 person likes this post

Hi Michael,

The way to see a target repository would depend on job type you are using. For example, for agent management backup jobs:

Code: Select all

$job = Get-VBRComputerBackupJob
$job.DestinationOptions.BackupRepository
For VMware or Hyper-V jobs:

Code: Select all

$job = Get-VBRJob
$job.GetTargetRepository()
Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests