Open Po-temkin opened 1 year ago
I know about that module VMware.Hv.Helper has Set-HVGlobalSettings cmdlet, but some new properties from Horizon 2303 aren't in it. How to set new functions, that Set-HVGlobalSettings not provided? With -Key and -Value they are not working.
$hvServer = Connect-HVServer *hvServer*
$ViewAPI = $hvServer.ExtensionData
Set-HVGlobalSettings -Key 'GeneralData.EnableAutomaticStatusUpdates' -Value $true
same as
$update = New-Object VMware.Hv.MapEntry
$update.Key = "GeneralData.EnableAutomaticStatusUpdates"
$update.Value = $true
$ViewAPI.GlobalSettings.GlobalSettings_update($update)
same as
$service = New-Object VMware.Hv.GlobalSettingsService
$service.GlobalSettings_Update($ViewAPI, $update)
Error:
MethodInvocationException: Exception calling "GlobalSettings_Update" with "1" argument(s): "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Invalid member name.
ParameterName : GeneralData.EnableAutomaticStatusUpdates"
Request of value works:
(Get-HVGlobalSettings).GeneralData.EnableAutomaticStatusUpdates
False
$ViewAPI.GlobalSettings.GlobalSettings_Get().GeneralData.EnableAutomaticStatusUpdates
False
$service.GlobalSettings_Get($ViewAPI).GeneralData.EnableAutomaticStatusUpdates
False
Describe the bug
I'm in the process of writing a function that will update all properties of $services.GlobalSettings.GlobalSettings_Get().GeneralData. I know about that module VMware.Hv.Helper has Set-HVGlobalSettings cmdlet, but some new properties from Horizon 2212 aren't in it. One of the properties is displayPreLoginMessage. When I try to set this property via function, I see this:
I wrote a simple function to reproduce the error. You can find it below. Interesting that everything is OK if I execute:
This also works (if i run it directly in shell):
UPD: The same situation with DisplayWarningBeforeForcedLogoff and EnableServerInSingleUserMode
Reproduction steps
Execute Set-HVGlobalGeneralSettings
Expected behavior
DisplayPreLoginMessage updating without errors.
Additional context
Horizon Connection Server 8.8.0 build - 21073894 Powershell 5.1 PowerCLI 12.7