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

Get targetdir ?

Post by dbastie »

Hi,

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

Thanks

Damien
Vitaliy S.
VP, Product Management
Posts: 27364
Liked: 2794 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Get targetdir ?

Post by Vitaliy S. »

Hi Damien,

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

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

Re: Get targetdir ?

Post by dbastie »

Thanks it work !

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

Damien
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get targetdir ?

Post by ThomasMc » 1 person likes this post

This one

Code: Select all

$b = Get-VBRBackup | ?{$_.JobName -eq "JobName" }
$b.GetStorages() | Select -First 1 DirPath
dbastie
Novice
Posts: 6
Liked: never
Joined: Dec 26, 2010 1:14 pm
Full Name: Damien BASTIÉ
Contact:

Re: Get targetdir ?

Post by dbastie »

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
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get targetdir ?

Post by ThomasMc »

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
Veteran
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Get targetdir ?

Post by Sethbartlett »

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
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Get targetdir ?

Post by ThomasMc »

Nice one, so it was in there :)
dbastie
Novice
Posts: 6
Liked: never
Joined: Dec 26, 2010 1:14 pm
Full Name: Damien BASTIÉ
Contact:

Re: Get targetdir ?

Post by dbastie »

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 5 guests