vmware / PowerCLI-Example-Scripts

http://blogs.vmware.com/powercli
Other
743 stars 601 forks source link

Updating Connection Server General settings #614

Open Sajkrish opened 1 year ago

Sajkrish commented 1 year ago

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

Mr-Kappelmann commented 4 months ago

possible: same problem in #607