Get targetdir ?

PowerShell script exchange

Get targetdir ?

Veeam Logoby dbastie » Tue Oct 25, 2011 4:10 pm

Hi,

How can retrieve with powershell the targetdir of each job ?
It is possible ?

Thanks

Damien
dbastie
Service Provider
 
Posts: 6
Liked: never
Joined: Sun Dec 26, 2010 1:14 pm
Full Name: Damien BASTIÉ

Re: Get targetdir ?

Veeam Logoby Vitaliy S. » Tue Oct 25, 2011 4:49 pm

Hi Damien,

Try using Get-VBRJob | Export-VBRJob PowerShell command, this will export all jobs configurations into XML file.

Thanks.
Vitaliy S.
Veeam Software
 
Posts: 19558
Liked: 1102 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

Re: Get targetdir ?

Veeam Logoby dbastie » Tue Oct 25, 2011 4:59 pm

Thanks it work !

But there is an another method in CLI to get Job Name and targetdir ?

Damien
dbastie
Service Provider
 
Posts: 6
Liked: never
Joined: Sun Dec 26, 2010 1:14 pm
Full Name: Damien BASTIÉ

Re: Get targetdir ?

Veeam Logoby ThomasMc » Tue Oct 25, 2011 5:08 pm

This one

Code: Select all
$b = Get-VBRBackup | ?{$_.JobName -eq "JobName" }
$b.GetStorages() | Select -First 1 DirPath
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Get targetdir ?

Veeam Logoby dbastie » Tue Oct 25, 2011 5:12 pm

ThomasMc wrote:This one

Code: Select all
$b = Get-VBRBackup | ?{$_.JobName -eq "JobName" }
$b.GetStorages() | Select -First 1 DirPath


Perfect ! Thanks a lot Thomas !
dbastie
Service Provider
 
Posts: 6
Liked: never
Joined: Sun Dec 26, 2010 1:14 pm
Full Name: Damien BASTIÉ

Re: Get targetdir ?

Veeam Logoby ThomasMc » Tue Oct 25, 2011 5:18 pm

dbastie wrote:
ThomasMc wrote:This one

Code: Select all
$b = Get-VBRBackup | ?{$_.JobName -eq "JobName" }
$b.GetStorages() | Select -First 1 DirPath


Perfect ! Thanks a lot Thomas !


Your welcome, not where I thought it would have been(I was thinking it would have been in Get-VBRJob somewhere) but works just as good.

Also note that I don't think this would work for jobs that have never been run as I don't think it would be able to find a backup file
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Get targetdir ?

Veeam Logoby Sethbartlett » Tue Oct 25, 2011 6:09 pm

For one job:
Code: Select all
$job = Get-VBRJob | ?{$_.name -eq "Job Name"}
$Job.info.targetdir


For all jobs:

Code: Select all
Get-VBRJob | %{$_.Info.TargetDir}
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Get targetdir ?

Veeam Logoby ThomasMc » Tue Oct 25, 2011 6:19 pm

Nice one, so it was in there :)
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Get targetdir ?

Veeam Logoby dbastie » Tue Oct 25, 2011 7:52 pm

Thanks Sethbartlett

(Need a full documentation about Veeam's powershell for next releases please :) )
dbastie
Service Provider
 
Posts: 6
Liked: never
Joined: Sun Dec 26, 2010 1:14 pm
Full Name: Damien BASTIÉ


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests