PowerCLI-Example-Scripts icon indicating copy to clipboard operation
PowerCLI-Example-Scripts copied to clipboard

Updating Connection Server General settings

Open Sajkrish opened this issue 1 year ago • 1 comments

Describe the bug

I am trying to update the Horizon Connection server general settings with PowerCLI as these appear to be exposed in the REST API unfortunately. The settings I need to change are

BypassTunnel BypassPCOIPGateway BypassAppBlastGateway

I'm using the below method to update these values however getting below error

$ViewAPI = $global:DefaultHVServers.ExtensionData $List = $ViewAPI.ConnectionServer.ConnectionServer_List().id $Update = new-object VMware.Hv.MapEntry $Update.key = "BypassPCoIPGateway" $Update.value = "False" $ViewAPI.ConnectionServer.ConnectionServer_Update($List,$Update)

MethodInvocationException: Exception calling "ConnectionServer_Update" with "2" argument(s): "ExceptionType : VMware.Hv.InvalidArgument ErrorMessage : Invalid member name. ParameterName : BypassPCoIPGateway"

Reproduction steps

Login to Connection server and execute the commands

$ViewAPI = $global:DefaultHVServers.ExtensionData $List = $ViewAPI.ConnectionServer.ConnectionServer_List().id $Update = new-object VMware.Hv.MapEntry $Update.key = "BypassPCoIPGateway" $Update.value = "False" $ViewAPI.ConnectionServer.ConnectionServer_Update($List,$Update)

Expected behavior

Expecting the values to be either set to True or false

BypassTunnel BypassPCOIPGateway BypassAppBlastGateway

Additional context

No response

Sajkrish avatar Jul 01 '23 15:07 Sajkrish