PowerShell script exchange
Post Reply
Steen
Service Provider
Posts: 48
Liked: 3 times
Joined: Mar 13, 2015 1:20 pm
Full Name: Steen
Contact:

Set Guest Interaction Proxy server

Post by Steen » 1 person likes this post

Its possible to enable/disabled Guest interaction Proxy (VssOptions.GuestProxyAutoDetect)

Is it possible to set specific Guest interaction proxy servers?
Regards Steen

PTide
Product Manager
Posts: 6098
Liked: 642 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Set Guest Interaction Proxy server

Post by PTide » 1 person likes this post

Hi,

No, it's not possible to set a specific guest interaction proxy via Powershell. Could you please explain your use case?

Thank you.

Steen
Service Provider
Posts: 48
Liked: 3 times
Joined: Mar 13, 2015 1:20 pm
Full Name: Steen
Contact:

Re: Set Guest Interaction Proxy server

Post by Steen » 2 people like this post

I want to change many jobs
Regards Steen

kbov
Novice
Posts: 7
Liked: 1 time
Joined: Apr 19, 2016 7:54 am
Contact:

[MERGED] : Put the Guest Interaction Proxy using Powershell

Post by kbov »

Hi,

I'm creating my jobs using Powershell. I would like put the Guest Interaction Proxy in manual mode, and specify the proxy server.

I'm able to put the manual mode with :

$VSSOptions = (Get-VBRJob -name "job").VSSOptions
$VSSOptions.GuestProxyAutoDetect = $false
Set-VBRJobVSSOptions -Job $Job -Options $VSSOptions

But I don't know how to put the correct Proxy server. If I execute this, the proxy textbox is empty :/

Any idea? :oops:

Thanks ^^

veremin
Product Manager
Posts: 19085
Liked: 1950 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set Guest Interaction Proxy server

Post by veremin »

You're not missing anything. Currently, this functionality is not available in PowerShell. Thanks.

kbov
Novice
Posts: 7
Liked: 1 time
Joined: Apr 19, 2016 7:54 am
Contact:

Re: Set Guest Interaction Proxy server

Post by kbov » 1 person likes this post

Thanks for the quick reply v.Eremin

stehardy
Lurker
Posts: 1
Liked: never
Joined: Sep 01, 2016 8:54 am
Full Name: Steven Hardy
Location: UK
Contact:

Re: Set Guest Interaction Proxy server

Post by stehardy »

Are there plans to add this functionality? We've got issues where Auto Select seems to be using the same proxy all of the time (our Backup Repository), rather than spreading the load between our 6 proxy servers (3 at each site). We'd like to be able to set these options quickly (we've got 100s of replication jobs)...

KFM
Service Provider
Posts: 13
Liked: 2 times
Joined: May 14, 2013 1:46 am
Full Name: KFM
Contact:

Re: Set Guest Interaction Proxy server

Post by KFM »

I'm guessing this functionality is still not in 9.5? Couldn't see anything obvious from the list of cmdlets from get-vbrcommands.

veremin
Product Manager
Posts: 19085
Liked: 1950 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set Guest Interaction Proxy server

Post by veremin »

Correct, no new cmdlets have been added for this matter. Also, I've checked briefly for a potential workaround and unfortunately found nothing.

marcseitz
Influencer
Posts: 17
Liked: 5 times
Joined: Apr 04, 2012 11:17 am
Full Name: Marc Seitz
Contact:

Re: Set Guest Interaction Proxy server

Post by marcseitz »

Hey Guys,

is there an update with 9.5 U1?
Really missing this feature :-(

In general, I hope to see all "GUI-Actions" as "Powershell-CMDlets" to make it easier to automate things in large environments.

Thanks,
Marc

veremin
Product Manager
Posts: 19085
Liked: 1950 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set Guest Interaction Proxy server

Post by veremin »

is there an update with 9.5 U1?
Nope, nothing has been changed in this regard.
In general, I hope to see all "GUI-Actions" as "Powershell-CMDlets" to make it easier to automate things in large environments.
We also do try to stick to this paradigm. However, I have to admit there is still a certain difference in what GUI and PoweShell might propose, which we're trying to cover.

Thanks.

olafurh
Veeam Vanguard
Posts: 20
Liked: 15 times
Joined: Oct 29, 2014 9:41 am
Full Name: Olafur Helgi Haraldsson
Location: Iceland
Contact:

Re: Set Guest Interaction Proxy server

Post by olafurh »

+1 for each job im clicking throug to change this. :cry:

poulpreben
Certified Trainer
Posts: 1021
Liked: 445 times
Joined: Jul 23, 2012 8:16 am
Full Name: Preben Berg
Contact:

Re: Set Guest Interaction Proxy server

Post by poulpreben »

+1 for adding the ability to select which guest proxy to utilize via the VSSOptions object.

Marcin_ITM
Lurker
Posts: 1
Liked: never
Joined: Feb 16, 2018 1:09 pm
Full Name: Marcin
Contact:

Re: Set Guest Interaction Proxy server

Post by Marcin_ITM »

+1 We need this functionality also. It was not added in 9.5 U3. Unfortunately Veeam Support does not know if, or when this functionality will be available in PoweShell.

tsightler
VP, Product Management
Posts: 5924
Liked: 2778 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Set Guest Interaction Proxy server

Post by tsightler » 1 person likes this post

For a temporary, unsupported workaround, you can use the following code:

Code: Select all

$Job = Get-VBRJob -Name "<Job_Name>"
$Gip = Get-VBRServer -Name "<Name_of_Guest_Interaction_Server>"

if (([Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.Id) | ?{$_.Type -eq "EGuest"})) { 
    write-host $gip.Name "is already a guest interaction proxy for this job!"
} else {
    [Veeam.Backup.Core.CJobProxy]::Create($Job.Id, $Gip.Id, "EGuest")
}
Please not that this code will let you do crazy things, like adding an ESXi host as a guest proxy, which won't work, so make sure you feed it the proper server types. You can of course add multiple guest interaction proxies, and you will need to set VssOptions.GuestProxyAutoDetect to $false using normal methods.

To delete a guest interaction proxy something like this should do it:

Code: Select all

$Job = Get-VBRJob -Name "<Job_Name>"
$Gip = Get-VBRServer -Name "<Name_of_Guest_Interaction_Server>"
$JobGip = [Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.id) | ?{$_.Type -eq "EGuest" -and $_.ProxyId -eq $Gip.Id}
if ($JobGip) {
    [Veeam.Backup.Core.CJobProxy]::Delete($JobGip.Id)
} else {
    write-host $Gip.Name "is not a guest interaction proxy for this job!"
}
As with all unsupported workarounds, please test in a development environment and don't try to open a support case. These workarounds are generally safe if you understand what you are changing and feed it correct data, however, if you feed it incorrect data, you can get in situations with invalid information in the database, which may cause issues with the GUI so make sure you understand how the code works before testing this in any production environment.

Markus_Wiesecke
Novice
Posts: 3
Liked: never
Joined: Jun 04, 2018 11:55 am
Full Name: Markus Wiesecke
Contact:

Re: Set Guest Interaction Proxy server

Post by Markus_Wiesecke »

We would need this feature "officially" too as we are rolling out a distributed veeam environment with >100 sites and >>400 jobs which are all similar and 200 use a guest interaction proxy on their side.

reaperhammer
Service Provider
Posts: 27
Liked: 8 times
Joined: Aug 18, 2016 7:59 pm
Full Name: Will S
Contact:

Re: Set Guest Interaction Proxy server

Post by reaperhammer »

I made this more functional script, this is only tested on 9.5.0.1536. I noticed that when comparing the $GipInJob.Id Property it does not match the (Get-VBRServer).Id Property GUIDs, rather $GipInJob.ProxyId matches (Get-VBRServer).Id objects so this differs from the example provided previously. Your own testing is still recommended.

Code: Select all

$VerbosePreference = "Continue"
$Jobs = Get-VBRJob -Name "<Job name>","<Another Job Name>","<Another Job Name>"
$Gip = Get-VBRServer -Name "Server you want to be GiP"
$AllServers = Get-VBRServer
foreach ($job in $jobs) {
#If there is no GiP assigned to this Job, then assign the one we want
    If (!(([Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.id) | ?{$_.Type -eq "EGuest"}))) {
    Write-Verbose "Job Had no Proxy assigned - Adding GiP $($Gip.Name) $($Gip.Id) to Job $($job.Name)"
    [Veeam.Backup.Core.CJobProxy]::Create($Job.Id, $Gip.Id, "EGuest")
    } else {
    #If there are some GiP's assigned to this Job, first add the one you want, then delete all others
    Foreach ($GipInJob in ([Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.id) | ?{$_.Type -eq "EGuest"})) {
        If ($GipInJob.ProxyId -eq $GiP.Id) {
        Write-Verbose "$($gip.Name) is already a guest interaction proxy for this job!"
        } else {
        Write-Verbose "Adding GiP $($Gip.Name) $($Gip.Id) to Job $($job.Name)"
        [Veeam.Backup.Core.CJobProxy]::Create($Job.Id, $Gip.Id, "EGuest")
        } #else
        If ($GipInJob.ProxyId -ne $GiP.Id) {
        Write-Verbose "Delete $(($AllServers | ? {$_.Id -eq $GipInJob.ProxyId}).Name) $($GipInJob.ProxyId) from $($job.Name)"
        [Veeam.Backup.Core.CJobProxy]::Delete($GipInJob.Id)
        } #If ($GipInJob.ProxyId -ne $GiP.Id)
        } #Foreach ($Proxy in...
        } #else
    #Check that the job has a Proxy assigned then set autodetect proxy to false
    If (!!(([Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.id) | ?{$_.Type -eq "EGuest"}))) {
    Write-Verbose "$($job.Name) has a poxy assigned"
    If ($job.GetVssOptions().GuestProxyAutoDetect -eq $True) {
    Write-Verbose "$($job.Name) is set to Autodetect so we will disable AutoDetect Proxy"
    $opt = $NULL
    $opt = $job.GetVssOptions()
    $opt.GuestProxyAutoDetect = $FALSE
    $job.SetVssOptions($opt)
    } else {
    Write-Verbose "$($job.Name) AutoDetect Proxy is already $False"
    } #else
    } #if (!!(([Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.id) | ?{$_.Type -eq "EGuest"})))
} #foreach ($job in $jobs)

Markus_Wiesecke
Novice
Posts: 3
Liked: never
Joined: Jun 04, 2018 11:55 am
Full Name: Markus Wiesecke
Contact:

Re: Set Guest Interaction Proxy server

Post by Markus_Wiesecke »

We are rolling out about 120 Locations with a veeam backup server, therefore I created a rollout-script in powershell for our needs and settings. Therefore, I was grateful to find this:
tsightler wrote:For a temporary, unsupported workaround, you can use the following code:

Code: Select all

$Job = Get-VBRJob -Name "<Job_Name>"
$Gip = Get-VBRServer -Name "<Name_of_Guest_Interaction_Server>"

if (([Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.Id) | ?{$_.Type -eq "EGuest"})) { 
    write-host $gip.Name "is already a guest interaction proxy for this job!"
} else {
    [Veeam.Backup.Core.CJobProxy]::Create($Job.Id, $Gip.Id, "EGuest")
}
...
As it puts the name of the guest interaction proxz into our VSS jobs, but using
..

Code: Select all

$gip=get-vbrserver -name $locserver
       [Veeam.Backup.Core.CJobProxy]::Create($job.Id, $gip.Id, "EGuest") 
       $vso=get-vbrjobvssoptions -job $job 
       $vso.guestproxyautodetect=$false
       $vso.guestfsindexingtype="EveryFolders"
       set-vbrjobvssoptions -job $job -options $vso
with $job is the job I am refering too. But the job remains on automatic selection, in the GUI I can change it to "Use the selected gutest interaction servers only" and if I select this, the machine I set via the first line of my code snip and I got it from the post I quote is preselected. So, how to I set the Guest InteractionProxy via Powershell correctly? Or is this a bug in the Powershell API?

veremin
Product Manager
Posts: 19085
Liked: 1950 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Set Guest Interaction Proxy server

Post by veremin »

Have you tried this script already?

Code: Select all

$VSSOptions = (Get-VBRJob -name "Name of your Job").VSSOptions
$VSSOptions.GuestProxyAutoDetect = $false
Set-VBRJobVSSOptions -Job $Job -Options $VSSOptions
Thanks.

timmi2704
Enthusiast
Posts: 96
Liked: 4 times
Joined: Jan 14, 2014 10:41 am
Full Name: Timo Brandt
Contact:

Re: Set Guest Interaction Proxy server

Post by timmi2704 »

Hi Vladimir,

unfortunately, I have the same issue as Markus.
Even if setting GuestProxyAutoDetect to false, this setting has no effect.
As soon as the VSSOptions are requested again with Get-VBRJobVSSOptions, I can see that Auto detect is still enabled. This can be confirmed in the GUI.

I know that setting the Guest Interaction Proxies is not supported that way, but changing the VSS options should be supported.
Do you have any idea why it does not work?
Shall I open a support case for that?

I'm running on 9.5.4.2753

Thanks a lot.

jhoughes
Expert
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Set Guest Interaction Proxy server

Post by jhoughes » 1 person likes this post

If you already have the guest interaction proxy set, and it is just disabled due to GuestProxyAutoDetect being set to false, then you can update the job with this:

Code: Select all

$VSSJob = Get-VBRJob -Name 'JobName'
$JobVSS = $VSSJob.GetVSSOptions()
$JobVSS.GuestProxyAutoDetect = $False
$VSSJob.SetVssOptions($JobVSS)
Here's a snippet of the code that I use to create new "shell" or "template" jobs with VSS enabled.

It's not everything set for the job, but the bits relevant to enabling VSS and both source & guest interaction proxy.

Code: Select all

#Variables
$VeeamProxyName = 'ausveeampxy01.lab.fullstackgeek.net'

#Get job & proxy objects objects
$VSSJob = Get-VBRJob -Name 'JobName'
$SourceProxy = Get-VBRViProxy -Name $VeeamProxyName
$GuestProxy = Get-VBRServer -Name $VeeamProxyName

#Enable VSS integration for new shell backup job
Enable-VBRJobVSSIntegration -Job $VSSJob

#Enable VSS integration and create VSS options object, set guest interaction proxy to new job
$JobVSS = $VSSJob.GetVSSOptions()
$JobVSS.VssSnapshotOptions.Enabled = $True
$JobVSS.VssSnapshotOptions.IgnoreErrors = $False
$JobVSS.GuestProxyAutoDetect = $False
[Veeam.Backup.Core.CJobProxy]::Create($VSSJob.Id, $GuestProxy.Id, "EGuest")

#Set job VSS options
$VSSJob.SetVssOptions($JobVSS)

#Set job proxy for backup
Set-VBRJobProxy -Job $VSSJob -Proxy $SourceProxy
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion

timmi2704
Enthusiast
Posts: 96
Liked: 4 times
Joined: Jan 14, 2014 10:41 am
Full Name: Timo Brandt
Contact:

Re: Set Guest Interaction Proxy server

Post by timmi2704 »

Hi Joe,
I appreciate the code you shared. :mrgreen:
But still, somehow setting GuestProxyAutoDetect to false does not have any effect at all.
I am able to create new jobs and modify all settings including VSS Options using PowerShell, it is just that I am not able to disable automatic proxy detection (which in most cases does not work for me anyway).

jhoughes
Expert
Posts: 279
Liked: 112 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Set Guest Interaction Proxy server

Post by jhoughes »

Do you have a proxy already selected?
Husband, Father, Solutions Architect, Geek Extraordinaire | @DenverVMUG, @AustinVMUG & @ATXPowerShell leader | VMware vExpert | Cisco Champion

Compmor
Novice
Posts: 4
Liked: never
Joined: May 15, 2019 7:04 pm
Full Name: Compmor
Location: Portugal
Contact:

Set Guest Interaction Proxy server

Post by Compmor »

This will help.

get-wmiobject -computername server1 -class win32_processor Select Name

I recommend upgrading PowerShell.

Markus_Wiesecke
Novice
Posts: 3
Liked: never
Joined: Jun 04, 2018 11:55 am
Full Name: Markus Wiesecke
Contact:

Re: Set Guest Interaction Proxy server

Post by Markus_Wiesecke »

tsightler wrote: Feb 19, 2018 9:28 pm

Code: Select all

$Job = Get-VBRJob -Name "<Job_Name>"
$Gip = Get-VBRServer -Name "<Name_of_Guest_Interaction_Server>"
$JobGip = [Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.id) | ?{$_.Type -eq "EGuest" -and $_.ProxyId -eq $Gip.Id}
if ($JobGip) {
    [Veeam.Backup.Core.CJobProxy]::Delete($JobGip.Id)
} else {
    write-host $Gip.Name "is not a guest interaction proxy for this job!"
}
Now we god to the phase where we are (mass-) replacing Proxies due to Win2008 -> Win2019 migration. So there is almost all scripted, of course I wanted also to script the change of guest interaction proxy. The normal proxy works fine, but I can add the new one with the code above (not quoted again), but I cannot delete the old like quoted, it gives me a

Code: Select all

Exception calling "GetJobProxies" with "1" argument(s): "Object reference not set to an instance of an object." 
from the 2nd line of the code snip. I tried without the .id or .id.guid, both without success.
Furthermore, we have a lot of BackupCopyJob using the WAN Accelerator feature. But I could not find a way to replace these, there are only "SET-" command lets for Backup Copy Jobs?

oleg.feoktistov
Veeam Software
Posts: 1296
Liked: 439 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Set Guest Interaction Proxy server

Post by oleg.feoktistov » 2 people like this post

Hi Markus,
I tried without the .id or .id.guid, both without success.
Try running these lines solely and check the output:

Code: Select all

$Job = Get-VBRJob -Name "<Job_Name>"
$JobGip = [Veeam.Backup.Core.CJobProxy]::GetJobProxies($Job.id) | ?{$_.Type -eq "EGuest"}
Furthermore, we have a lot of BackupCopyJob using the WAN Accelerator feature. But I could not find a way to replace these, there are only "SET-" command lets for Backup Copy Jobs?
Currently, there is no dedicated cmdlet/attribute to set Wan Accelerators for Backup Copy Jobs.
However, you can try the workaround below to set them using methods:

Code: Select all

$wanServers = Get-VBRWanAccelerator
$backupCopy = Get-VBRJob | where {$_.JobType -eq 'BackupSync'}
foreach ($job in $backupCopy) {
$wanAccelerators = [Veeam.Backup.Core.CJobWanAccelerator]::GetJobWanAccelerators($backupCopy.id)
foreach ($wan in $wanAccelerators) {
[Veeam.Backup.Core.CJobWanAccelerator]::Delete($wan.id)
}
[Veeam.Backup.Core.CJobWanAccelerator]::Create($backupCopy.id, $wanServers[0].id, "ESource")
[Veeam.Backup.Core.CJobWanAccelerator]::Create($backupCopy.id, $wanServers[1].id, "ETarget")
}

Best regards,
Oleg

Henrik.Grevelund
Service Provider
Posts: 124
Liked: 16 times
Joined: Feb 13, 2017 2:56 pm
Full Name: Henrik Grevelund
Contact:

Re: Set Guest Interaction Proxy server

Post by Henrik.Grevelund »

Hi,

It seems like this still isn't supported yet ?
Will be supported in version 11 ?

I have 59 jobs to change, both Guest interaction proxy and Log shipping server.
Have nice day,
Henrik

oleg.feoktistov
Veeam Software
Posts: 1296
Liked: 439 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Set Guest Interaction Proxy server

Post by oleg.feoktistov »

Hi Henrik,

The code above works fine in v10, though it's not supported officially. If you are talking about documented cmdlets, then no, it's not planned for v11.
Nonetheless, if you have any questions on unsupported scripts, feel free to ask on our forum.

Thanks,
Oleg

adb98
Enthusiast
Posts: 63
Liked: 13 times
Joined: Jul 21, 2016 5:03 pm
Full Name: Aaron B
Contact:

Re: Set Guest Interaction Proxy server

Post by adb98 »

So this pretty much sucks for me. So here is my dilemma..... I am not sure if others have run into this or not.

I am looking at setting up multiple file server backup jobs but I am going to have to go thru hell and back to do so because of this feature missing. My issue is when you add a new file server you have to add each file server as a managed server. So now if I have my guest interaction server set to automatic for my 300 jobs (which they are) they are now picking a random file server to use as a guest interaction proxy. A big oh hell no for me. So I have to go thru each job and make this change.

Either remove File Servers as managed servers or remove them from the options of guest interaction proxies or add this command which is clearly a high request from power users!!

oleg.feoktistov
Veeam Software
Posts: 1296
Liked: 439 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Set Guest Interaction Proxy server

Post by oleg.feoktistov »

Hi Aaron,

I noted your request for a cmdlet to set guest interaction proxy.
Won't make it to v11 as this is a little bit late for that, but certainly worth discussing in scope of vNext.

Thanks,
Oleg

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests