PowerShell script exchange
Post Reply
munklarsen
Service Provider
Posts: 22
Liked: 8 times
Joined: Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen
Contact:

Powershell - Get Storage Folder

Post by munklarsen » Mar 06, 2015 12:10 pm

Hi guys,

I've been trying to find a way to find the entire path of the folder used for storing the backups of a particular job.

I've tried but that only gives me the root of the storage repository, not the subdirectory where my backup is stored.

Code: Select all

(Get-VBRJob -Name 'jobName').TargetDir
Veeam must know this directory's name and have it stored somewhere - the thing is that someone changed the name of the backup job and that was how i used to generate the entire path to the backup.

veremin
Product Manager
Posts: 17419
Liked: 1548 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell - Get Storage Folder

Post by veremin » Mar 06, 2015 12:12 pm

Just a quick question - what type of repository you're using? Windows-based, Linux-based, CIFS share, etc.

munklarsen
Service Provider
Posts: 22
Liked: 8 times
Joined: Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen
Contact:

Re: Powershell - Get Storage Folder

Post by munklarsen » Mar 06, 2015 12:29 pm 1 person likes this post

Hi...

As always, you spend some time working on it, then you turn to the forums for help... and then five minutes later, you solve the issue.

Fixed it like this:

Code: Select all

$JobID = (Get-VBRJob -Name '<JobName>').Info.Id

(Get-VBRBackup | Where-Object ({$_.Info.JobId -eq $JobID})).DirPath
I could find the directory using the Get-VBRBackup and but this had no references to the new job name. So had to find some common ground which then was the Info.Id of the Get-VBRJob and the Info.JobId of the Get-VBRJob.

munklarsen
Service Provider
Posts: 22
Liked: 8 times
Joined: Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen
Contact:

Re: Powershell - Get Storage Folder

Post by munklarsen » Mar 06, 2015 12:31 pm

And to answer you question v.Erimin, I'm using a Windows repository.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests