PowerShell script exchange
Post Reply
htwnrva
Enthusiast
Posts: 32
Liked: never
Joined: Jan 20, 2010 6:59 pm
Full Name: Ronny
Contact:

PowerShell Choose a specific backup proxy

Post by htwnrva »

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

Re: PowerShell Choose a specific backup proxy

Post by Sethbartlett »

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.
htwnrva
Enthusiast
Posts: 32
Liked: never
Joined: Jan 20, 2010 6:59 pm
Full Name: Ronny
Contact:

Re: PowerShell Choose a specific backup proxy

Post by htwnrva »

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: 32
Liked: never
Joined: Jan 20, 2010 6:59 pm
Full Name: Ronny
Contact:

Re: PowerShell Choose a specific backup proxy

Post by htwnrva »

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

Re: PowerShell Choose a specific backup proxy

Post by Sethbartlett »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests