PowerShell Choose a specific backup proxy

PowerShell script exchange

PowerShell Choose a specific backup proxy

Veeam Logoby htwnrva » Fri Jan 20, 2012 5:28 pm

with Veeam v6 Powershell cmdlets is there a way to select a specific backup proxy for a job? I can change from Automatic selection using $jobOptions.JobOptions.SourceProxyAutoDetect = $False but it still has all 3 Proxies checked. I can't figure out how to select a specific proxy server for the job.
htwnrva
Enthusiast
 
Posts: 30
Liked: never
Joined: Wed Jan 20, 2010 6:59 pm
Full Name: Ronny

Re: PowerShell Choose a specific backup proxy

Veeam Logoby Sethbartlett » Sun Jan 22, 2012 6:56 pm

Took me a few but I found it:

Code: Select all
$Job = Get-VBRJob -name "Your Job"
$Proxy = Get-VBRViProxy -name "ProxyToAdd"
$Type = [Veeam.Backup.Model.CJobProxyInfo+EType]::ESource
[Veeam.Backup.Core.CJobProxy]::Create($job.id, $proxy.id, $type)

This will add that proxy as a source proxy to the job. If you need to do targetproxy, change "ESource" to "ETarget"
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: PowerShell Choose a specific backup proxy

Veeam Logoby htwnrva » Thu Jan 26, 2012 9:04 pm

Thank you that got me closer. Now do you know how to remove the existing checkboxes? So when you switch from Automatic selection to specified servers it automatically checks the box for all of them. I'll need to clear all checkmarks and then use your code above to check the proxy we want back.
htwnrva
Enthusiast
 
Posts: 30
Liked: never
Joined: Wed Jan 20, 2010 6:59 pm
Full Name: Ronny

Re: PowerShell Choose a specific backup proxy

Veeam Logoby htwnrva » Thu Jan 26, 2012 9:20 pm

Here is the reference question as to why I need to change these settings for fyi. I'd imagine I won't be the only person with this setup.

Backup Proxy Design Question
htwnrva
Enthusiast
 
Posts: 30
Liked: never
Joined: Wed Jan 20, 2010 6:59 pm
Full Name: Ronny

Re: PowerShell Choose a specific backup proxy

Veeam Logoby Sethbartlett » Sat Jan 28, 2012 1:57 am

So the question is, when you check the "automatic" box, does it recheck all the proxies again? I think it just sets that bit to "true". So you could go from X proxies to "autodetect" true. Does that make sense or do you need more granular and the ability to go back and forth?
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


Return to PowerShell



Who is online

Users browsing this forum: Google [Bot] and 8 guests