Closed rpaloni closed 3 years ago
Sorry for late... I solved by myself my issue.
It's not a bug. I'm only understand how the "Pool Object" is made. So...
$thisPool = Get-HVPool -PoolName $poolName
$logoffSettings = $thispool.DesktopSettings.LogoffSettings
$logoofSettings.AutomaticLogoffPolicy = AFTER
$logoofSettings.AutomaticLogoffMinutes= 15
Set-HVPool -Pool $thisPool -key "desktopSettings.logoffSettings" -value $logoffSettings
PS C:\Windows\system32> $patternSettings = $pool.AutomatedDesktopData.VmNamingSettings.PatternNamingSettings PS C:\Windows\system32> $patternSettings.MaxNumberOfMachines = 4 PS C:\Windows\system32> Set-HVPool -Poolname 'FulClnJSON' -Key 'automatedDesktopData.vmNamingSpec.patternNamingSettings' -Value $patternSettings Updating the Pool: FulClnJSON Exception calling "Desktop_Update" with "3" argument(s): "ExceptionType : VMware.Hv.InvalidArgument ErrorMessage : Invalid member name. ParameterName : automatedDesktopData.vmNamingSpec.patternNamingSettings" At C:\Program Files\WindowsPowerShell\Modules\VMware.Hv.Helper\VMware.HV.Helper.psm1:6442 char:8
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : VimException
Hi,
I have a Pool configured ad NEVER Logoff when disconnect I want to change it to AFTER 15 Minutes
If I try to use this command:
Set-HVPool -PoolName $PoolName -Key "desktopSettings.logoffSettings.automaticLogoffPolicy" -Value "AFTER"
I receive this error:
Cause automaticLogoffMinutes is mandatory for automaticLogoffPolicy
So If I try to set automaticLogoffMinutes before automaticLogoffMinutes: Set-HVPool -PoolName $PoolName -Key "desktopSettings.logoffSettings.automaticLogoffMinutes" -Value 15
even if no error was given, the key was not updated in the pool probably cause automaticLogoffPolicy is set to NEVER.
How can I updates automaticLogoffMinutes and automaticLogoffPolicy simultanosly and correctly