Powershell - Get Storage Folder

PowerShell script exchange

Powershell - Get Storage Folder

Veeam Logoby munklarsen » Fri 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.
munklarsen
Influencer
 
Posts: 13
Liked: 6 times
Joined: Thu Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen

Re: Powershell - Get Storage Folder

Veeam Logoby v.Eremin » Fri Mar 06, 2015 12:12 pm

Just a quick question - what type of repository you're using? Windows-based, Linux-based, CIFS share, etc.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Powershell - Get Storage Folder

Veeam Logoby munklarsen » Fri 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
Influencer
 
Posts: 13
Liked: 6 times
Joined: Thu Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen

Re: Powershell - Get Storage Folder

Veeam Logoby munklarsen » Fri Mar 06, 2015 12:31 pm

And to answer you question v.Erimin, I'm using a Windows repository.
munklarsen
Influencer
 
Posts: 13
Liked: 6 times
Joined: Thu Nov 15, 2012 11:02 pm
Full Name: Michael Munk Larsen


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests