-
- Novice
- Posts: 8
- Liked: 2 times
- Joined: Jun 21, 2012 7:34 pm
- Full Name: Kevin Foster
- Contact:
Set-VBRJobProxy - Multiple Proxies
I want to specify multiple proxies for specific jobs via powershell. It appears Set-VBRJobProxy can only set a single proxy to a Job. Is there a way around this? Any examples would be great.
Thank you,
Kevin
Thank you,
Kevin
-
- Product Manager
- Posts: 20413
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Set-VBRJobProxy - Multiple Proxies
Proxy (-Proxy) parameter of the said commandlet accepts multiple proxy entities, so, setting array of proxies should work without any issues, like:
If that doesn't happen, can you please post a code you're trying to execute?
Thanks.
Code: Select all
Set-VBRJobProxy -Job $Job -Proxy $Proxies
Thanks.
-
- Novice
- Posts: 8
- Liked: 2 times
- Joined: Jun 21, 2012 7:34 pm
- Full Name: Kevin Foster
- Contact:
Re: Set-VBRJobProxy - Multiple Proxies
I thought the same thing but when I run the following code I get the error in red. I am using the names of the proxies as they are displayed in the console.
Set-VBRJobProxy : Cannot bind parameter 'Proxy'. Cannot convert the "fakeproxy107v.somedomain.com" value of type
"System.String" to type "Veeam.Backup.Core.IProxy".
At line:6 char:47
+ Set-VBRJobProxy -Job $Job.Name -Proxy $Proxies
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-VBRJobProxy], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Veeam.Backup.PowerShell.Command.SetVBRJobProxy
Code: Select all
$Proxies = "fakeproxy107v.somedomain.com","fakeproxy108v.somedomain.com","fakeproxy109v.somedomain.com","fakeproxy113v.somedomain.com","fakeproxy114v.somedomain.com","fakeproxy115v.somedomain.com","fakeproxy116v.somedomain.com","fakeproxy117v.somedomain.com","fakeproxy118v.somedomain.com"
$Jobs = Get-VBRJob | Where Name -Like "AUS_TEST*"
foreach ($Job in $jobs)
{
Set-VBRJobProxy -Job $Job.Name -Proxy $Proxies
}
"System.String" to type "Veeam.Backup.Core.IProxy".
At line:6 char:47
+ Set-VBRJobProxy -Job $Job.Name -Proxy $Proxies
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-VBRJobProxy], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Veeam.Backup.PowerShell.Command.SetVBRJobProxy
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: Set-VBRJobProxy - Multiple Proxies
It seems that you are giving it an array of strings, while it expects to get an array of objects (proxy is an object) Please try the following syntax:
$myArray=$var1,$var2,$var3,$var4
where each $varN is Get-VBRViProxy -Name "Proxy Name"
$myArray=$var1,$var2,$var3,$var4
where each $varN is Get-VBRViProxy -Name "Proxy Name"
-
- Novice
- Posts: 8
- Liked: 2 times
- Joined: Jun 21, 2012 7:34 pm
- Full Name: Kevin Foster
- Contact:
Re: Set-VBRJobProxy - Multiple Proxies
Thank you! I used the following to get the Proxies I needed.
Code: Select all
$Proxies = Get-VBRViProxy | where Name -Like "*aus*"
-
- Product Manager
- Posts: 20413
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Set-VBRJobProxy - Multiple Proxies
Also, -Job parameter should be of a different type. Currently, you're trying to pass a string object to it ($Job.name is a string), while it accepts CBackupJob entities, instead. So, you should use $Job variable, not $Job.name. Thanks.
-
- Novice
- Posts: 8
- Liked: 2 times
- Joined: Jun 21, 2012 7:34 pm
- Full Name: Kevin Foster
- Contact:
Re: Set-VBRJobProxy - Multiple Proxies
Good to know. It worked using the $Job.Name so I got lucky! Still trying to figure this all out!v.Eremin wrote:Also, -Job parameter should be of a different type. Currently, you're trying to pass a string object to it ($Job.name is a string), while it accepts CBackupJob entities, instead. So, you should use $Job variable, not $Job.name. Thanks.
Thank you all for your help!
PS Just saw the big red print about POSTING AN ERROR... I did have a case but they said they couldn't help and gave me the URL for this forum Case # 01073141
-
- Product Manager
- Posts: 20413
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Set-VBRJobProxy - Multiple Proxies
Glad to hear you've sorted it our.
Support case is required while posting about technical issues and similar. In the meantime, if you're looking for a general advice or need some help with scripting it's OK to post without it.
Thanks.
Support case is required while posting about technical issues and similar. In the meantime, if you're looking for a general advice or need some help with scripting it's OK to post without it.
Thanks.
Who is online
Users browsing this forum: No registered users and 4 guests