PowerShell script exchange
Post Reply
dbastie
Service Provider
Posts: 6
Liked: never
Joined: Dec 26, 2010 1:14 pm
Full Name: Damien BASTIÉ
Contact:

Get targetdir ?

Post by dbastie » Oct 25, 2011 4:10 pm

Hi,

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

Thanks

Damien

Vitaliy S.
Veeam Software
Posts: 21738
Liked: 1307 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Get targetdir ?

Post by Vitaliy S. » 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.

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

Re: Get targetdir ?

Post by dbastie » Oct 25, 2011 4:59 pm

Thanks it work !

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

Damien

ThomasMc
Expert
Posts: 293
Liked: 17 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get targetdir ?

Post by ThomasMc » Oct 25, 2011 5:08 pm

This one

Code: Select all

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

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

Re: Get targetdir ?

Post by dbastie » 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 !

ThomasMc
Expert
Posts: 293
Liked: 17 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get targetdir ?

Post by ThomasMc » Oct 25, 2011 5:18 pm

dbastie wrote: 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

Sethbartlett
Expert
Posts: 282
Liked: 25 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Get targetdir ?

Post by Sethbartlett » 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.

ThomasMc
Expert
Posts: 293
Liked: 17 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get targetdir ?

Post by ThomasMc » Oct 25, 2011 6:19 pm

Nice one, so it was in there :)

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

Re: Get targetdir ?

Post by dbastie » Oct 25, 2011 7:52 pm

Thanks Sethbartlett

(Need a full documentation about Veeam's powershell for next releases please :) )

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests