<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Having issues with adding a user to the exceptions lists in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807466#M97980</link>
    <description>&lt;P&gt;So I am having a problem with this script, I am trying to add on to the exceptions list for lockdown mode. And when I run it, it is replacing the whole list of users with just one user. Is there a way I can add on instead of replacing the whole list? I am trying to help automate the onboarding procedures for vcenter/esxi. The idea I thought might work is to call upon a csv with the list of users and just have the script initially add the new user to that csv. But I hoping there is a better way of keeping the exceptions list in tacked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##############################################&lt;BR /&gt;# PowerCLI to create users and give them proper permissions&lt;BR /&gt;# Writen by McLovin on 11/03/2020&lt;BR /&gt;#############################################&lt;BR /&gt;$Credential = Import-CliXml -Path /Host_adminCred.xml&lt;BR /&gt;$esxihost = @(Host_Ip)&lt;BR /&gt;$vcenter = @(Vcenter_ip)&lt;BR /&gt;Connect-VIServer -Server $esxihost -Credential $Credential | Out-null&lt;BR /&gt;Write-host "Connected to $esxihost"&lt;BR /&gt;$username = read-host 'Input username'&lt;BR /&gt;$pass = read-host 'Input password'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;foreach($esx in $esxihost){&lt;BR /&gt;Try{&lt;BR /&gt;Get-VMHostAccount -User $username -Server $esx -ErrorAction Stop&lt;BR /&gt;Write-host "$username is already in use."&lt;BR /&gt;}&lt;BR /&gt;Catch{&lt;BR /&gt;$user = New-VMHostAccount -Id $username -Password $pass -description Administrator -Server $esx&lt;BR /&gt;Write-host "$username has been created on $esx"&lt;BR /&gt;$rootfolder = Get-folder -server $esx -name root | select -first 1&lt;BR /&gt;New-ViPermission -Entity $rootfolder -Principal $username -Role Admin -Server $esx | out-null&lt;BR /&gt;Write-host "$username has been given $rootfolder permissions on $esx"&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;##############################################&lt;BR /&gt;# PowerCLI to add created user to the expections users and enable lockout mode.&lt;BR /&gt;# Writen by McLovin on 11/05/2020&lt;BR /&gt;#############################################&lt;BR /&gt;$AdminCredential = Import-CliXml -Path /VCA_AdminCred.xml&lt;BR /&gt;Connect-VIServer -Server $vcenter -Credential $AdminCredential | Out-null&lt;BR /&gt;Write-host "Connected to $vcenter"&lt;BR /&gt;$hosts = Get-VMhost&lt;/P&gt;&lt;P&gt;Foreach($vmhost in $hosts){&lt;BR /&gt;try{&lt;BR /&gt;$status = (Get-VMHost -name $vmhost).ExtensionData.Config.LockdownMode # checks lockdown mode&lt;BR /&gt;write-host "$status is set on $vmhost"&lt;BR /&gt;if($status -eq "lockdownDisabled"){&lt;BR /&gt;(get-vmhost $vmhost | get-view).EnterLockdownMode() # sets lockdown mode to enabled.&lt;BR /&gt;write-host "Lockdown is now set to enabled on $vmhost"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;catch{&lt;BR /&gt;(Get-VMHost -name $vmhost).ExtensionData.Config.LockdownMode&lt;BR /&gt;write-host "Lockdown is already set to enabled on $vmhost"&lt;BR /&gt;}&lt;BR /&gt;$HostAccess = Get-View -Id $vmhost.ExtensionData.ConfigManager.HostAccessManager&lt;BR /&gt;$HostAccess.UpdateLockdownExceptions($username)&lt;BR /&gt;Write-host "$username has been added to the Exception Users List on $vmhost"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Write-host "Disconnecting from $esxihost"&lt;BR /&gt;Disconnect-VIServer -Server $esxihost -Force -confirm:$false&lt;BR /&gt;Write-host "Disconnecting from $vcenter"&lt;BR /&gt;Disconnect-VIServer -Server $vcenter -Force -confirm:$false&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 00:17:55 GMT</pubDate>
    <dc:creator>dmcgovern</dc:creator>
    <dc:date>2020-11-09T00:17:55Z</dc:date>
    <item>
      <title>Having issues with adding a user to the exceptions lists</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807466#M97980</link>
      <description>&lt;P&gt;So I am having a problem with this script, I am trying to add on to the exceptions list for lockdown mode. And when I run it, it is replacing the whole list of users with just one user. Is there a way I can add on instead of replacing the whole list? I am trying to help automate the onboarding procedures for vcenter/esxi. The idea I thought might work is to call upon a csv with the list of users and just have the script initially add the new user to that csv. But I hoping there is a better way of keeping the exceptions list in tacked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;##############################################&lt;BR /&gt;# PowerCLI to create users and give them proper permissions&lt;BR /&gt;# Writen by McLovin on 11/03/2020&lt;BR /&gt;#############################################&lt;BR /&gt;$Credential = Import-CliXml -Path /Host_adminCred.xml&lt;BR /&gt;$esxihost = @(Host_Ip)&lt;BR /&gt;$vcenter = @(Vcenter_ip)&lt;BR /&gt;Connect-VIServer -Server $esxihost -Credential $Credential | Out-null&lt;BR /&gt;Write-host "Connected to $esxihost"&lt;BR /&gt;$username = read-host 'Input username'&lt;BR /&gt;$pass = read-host 'Input password'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;foreach($esx in $esxihost){&lt;BR /&gt;Try{&lt;BR /&gt;Get-VMHostAccount -User $username -Server $esx -ErrorAction Stop&lt;BR /&gt;Write-host "$username is already in use."&lt;BR /&gt;}&lt;BR /&gt;Catch{&lt;BR /&gt;$user = New-VMHostAccount -Id $username -Password $pass -description Administrator -Server $esx&lt;BR /&gt;Write-host "$username has been created on $esx"&lt;BR /&gt;$rootfolder = Get-folder -server $esx -name root | select -first 1&lt;BR /&gt;New-ViPermission -Entity $rootfolder -Principal $username -Role Admin -Server $esx | out-null&lt;BR /&gt;Write-host "$username has been given $rootfolder permissions on $esx"&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;##############################################&lt;BR /&gt;# PowerCLI to add created user to the expections users and enable lockout mode.&lt;BR /&gt;# Writen by McLovin on 11/05/2020&lt;BR /&gt;#############################################&lt;BR /&gt;$AdminCredential = Import-CliXml -Path /VCA_AdminCred.xml&lt;BR /&gt;Connect-VIServer -Server $vcenter -Credential $AdminCredential | Out-null&lt;BR /&gt;Write-host "Connected to $vcenter"&lt;BR /&gt;$hosts = Get-VMhost&lt;/P&gt;&lt;P&gt;Foreach($vmhost in $hosts){&lt;BR /&gt;try{&lt;BR /&gt;$status = (Get-VMHost -name $vmhost).ExtensionData.Config.LockdownMode # checks lockdown mode&lt;BR /&gt;write-host "$status is set on $vmhost"&lt;BR /&gt;if($status -eq "lockdownDisabled"){&lt;BR /&gt;(get-vmhost $vmhost | get-view).EnterLockdownMode() # sets lockdown mode to enabled.&lt;BR /&gt;write-host "Lockdown is now set to enabled on $vmhost"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;catch{&lt;BR /&gt;(Get-VMHost -name $vmhost).ExtensionData.Config.LockdownMode&lt;BR /&gt;write-host "Lockdown is already set to enabled on $vmhost"&lt;BR /&gt;}&lt;BR /&gt;$HostAccess = Get-View -Id $vmhost.ExtensionData.ConfigManager.HostAccessManager&lt;BR /&gt;$HostAccess.UpdateLockdownExceptions($username)&lt;BR /&gt;Write-host "$username has been added to the Exception Users List on $vmhost"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Write-host "Disconnecting from $esxihost"&lt;BR /&gt;Disconnect-VIServer -Server $esxihost -Force -confirm:$false&lt;BR /&gt;Write-host "Disconnecting from $vcenter"&lt;BR /&gt;Disconnect-VIServer -Server $vcenter -Force -confirm:$false&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 00:17:55 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807466#M97980</guid>
      <dc:creator>dmcgovern</dc:creator>
      <dc:date>2020-11-09T00:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Having issues with adding a user to the exceptions lists</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807500#M97981</link>
      <description>&lt;P&gt;I don't think you should use a try-catch construction in your 2nd script.&lt;BR /&gt;There is no terminating error in that try-block that would help you achieve what you are trying to do.&lt;/P&gt;&lt;P&gt;Also, the disconnect from the ESXi node at the end of the 2nd script seems out of place.&lt;/P&gt;&lt;P&gt;Try something like this for the 2nd part.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$AdminCredential&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Import-Clixml&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Path&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;VCA_AdminCred.xml&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Connect-VIServer&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Server&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;$vcenter&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Credential&amp;nbsp;&lt;/SP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DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;$HostAccess&lt;/SPAN&gt;&lt;SPAN&gt;.UpdateLockdownExceptions&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$username&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Write-Host&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;$username&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;has&amp;nbsp;been&amp;nbsp;added&amp;nbsp;to&amp;nbsp;the&amp;nbsp;Exception&amp;nbsp;Users&amp;nbsp;List&amp;nbsp;on&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;$vmhost&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;#&lt;/SPAN&gt;&lt;SPAN&gt;Write-Host&amp;nbsp;"Disconnecting&amp;nbsp;from&amp;nbsp;$esxihost"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;#&lt;/SPAN&gt;&lt;SPAN&gt;Disconnect-VIServer&amp;nbsp;-Server&amp;nbsp;$esxihost&amp;nbsp;-Force&amp;nbsp;-confirm:$false&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Write-Host&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;Disconnecting&amp;nbsp;from&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;$vcenter&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Disconnect-VIServer&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Server&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;$vcenter&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;Force&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;confirm:&lt;/SPAN&gt;&lt;SPAN&gt;$false&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 09 Nov 2020 07:20:54 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807500#M97981</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2020-11-09T07:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Having issues with adding a user to the exceptions lists</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807767#M98000</link>
      <description>&lt;P&gt;Hey LucD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the advice on the 2nd function but that's not the problem I am having. The issue is that when I run this script it completely replaces the exception list with the newly created user. Is there a way I can just add a user to this list? If not I can think up a way to fix my problem.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 20:22:41 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807767#M98000</guid>
      <dc:creator>dmcgovern</dc:creator>
      <dc:date>2020-11-09T20:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Having issues with adding a user to the exceptions lists</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807773#M98001</link>
      <description>&lt;P&gt;Ok, I see.&lt;/P&gt;&lt;P&gt;In that case, first get the current list, then add the user and then call the method.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;$HostAccess = Get-View -Id $vmhost.ExtensionData.ConfigManager.HostAccessManager
$currentUsers = $HostAcces.QueryLockdownExceptions()
$newUsers = $currentUsers + $username
$HostAccess.UpdateLockdownExceptions($newUsers)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 20:28:44 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Having-issues-with-adding-a-user-to-the-exceptions-lists/m-p/2807773#M98001</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2020-11-09T20:28:44Z</dc:date>
    </item>
  </channel>
</rss>

