Reply to Message

View discussion in a popup

Replying to:
LucD
Leadership
Leadership

Ok, I see.

In that case, first get the current list, then add the user and then call the method.

$HostAccess = Get-View -Id $vmhost.ExtensionData.ConfigManager.HostAccessManager
$currentUsers = $HostAcces.QueryLockdownExceptions()
$newUsers = $currentUsers + $username
$HostAccess.UpdateLockdownExceptions($newUsers)

 


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference