I am trying to configure 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 I've assigned to $csServicesGeneral
$csServicesGeneral = New-Object VMware,HVConnectionServerGeneralData
These include:- (amongst other properties)
BypassTunnel
BypassPCOIPGateway
BypassAppBlastGateway
The above are boolean and I can easily set there values but I am unsure how to put these values back into the API.
I've been attempting to use
$hvservice.ConnectionServer.ConnectionServer_Update method but am unsure how to provide the required data for this method to be able to update my Connection servers. I think I need to provide a VMware.Hv.MapEntry but how can I build this and send to the API.
Cheers
There is an example in Service Types Overview (vmware.com)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the reference. I followed the example but whatever I throw at the update method gets returned with the following error 'You cannot call a method on a null-valued expression.'
I am ending up with a fully populated $csid object and $updates VMware.HV.MapEntry entry so I'm not sure why the method returns this error.
I've tried the following:-
$csList = $hvServices.ConnectionServer.ConnectionServer_List()
$csId = $csList[0].id
$update = new-object VMware.Hv.MapEntry
$update.key = "general.bypasstunnel"
$update.value = $True
$hvServices.ConnectionServer.ConnectionServer_Update($csId, $update)
I've tried populating my $update object in all sorts of different manners but the error is always the same. Does this have something to do with me needing to populate my VMware.HV.MapEntry as an array. If so how do I format the code to do this. In this instance I am trying to change the
$hvservice.ConnectionServer.ConnectionServer_List().General setting for BypassTunnel but I need to configure others in this section as well.
Cheers