vmware / PowerCLI-Example-Scripts

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

GlobalSettings.GlobalSettings_Update metod error #589

Open Po-temkin opened 1 year ago

Po-temkin commented 1 year ago

Describe the bug

If i set only propetry "reauthSecureTunnelAfterInterruption"

Exception on call  "GlobalSettings_Update" with "1" arguments: "There is an error in the XML document."
string:3 character:1
+ $ViewAPI.GlobalSettings.GlobalSettings_Update($MapEntry)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : InvalidOperationException

If i trying to set others

Exception on call "GlobalSettings_Update" with "1" arguments: "ExceptionType : VMware.Hv.InvalidArgument
ErrorMessage : Cannot update member with read-only fields.
ParameterName : securityData"
string:3 character:1
+ $ViewAPI.GlobalSettings.GlobalSettings_Update($MapEntry)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : VimException

Reproduction steps

$ViewServer = Connect-HVServer -server $fqdn -user $user -password $pass -domain $domain
$ViewAPI = $ViewServer.ExtensionData

$GlobalSettingsSecurityData = New-Object VMware.Hv.GlobalSettingsSecurityData -Property @{reauthSecureTunnelAfterInterruption=$false}
$MapEntry = New-Object VMware.Hv.MapEntry -Property @{Key='securityData';Value=$GlobalSettingsSecurityData}
$ViewAPI.GlobalSettings.GlobalSettings_Update($MapEntry)

Expected behavior

Metod succesfully update Global Security settings.

Additional context

Horizon Connection Server 8.6.0 build - 20099816