VMware Cloud Community
firestartah
Virtuoso
Virtuoso

Script to list all local accounts on each ESXi host for security checking

Hi,

Is there a script or command i can run against my environment to prove to the security team for audits that only permissable accounts are added to the ESXi hosts?

Gregg

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful". Gregg http://thesaffageek.co.uk
0 Kudos
2 Replies
firestartah
Virtuoso
Virtuoso

nevermind i found the solution in another thread:

$user = "root"
$pswd
= "password"

Get-VMHost
| %{
 
$esx = Connect-VIServer $_.Name -User $user -Password $pswd
  Get-VMHostAccount -Server $esx |
 
Select @{N="Host";E={$esx.Name}},@{N="Uid";E={$_.ExtensionData.Id}},Id,@{N="Name";E={$_.ExtensionData.FullName}}
 
Disconnect-VIServer -Server $esx -Confirm:$false
}

If you found this or other information useful, please consider awarding points for "Correct" or "Helpful". Gregg http://thesaffageek.co.uk
0 Kudos
green0tree22
Contributor
Contributor

Hi Firestartah.

 

Is this also applicable in vcenter? if not, how can i query the localaaccount in vcenter and check the status of acount and last password change?

i dont know how to check it using powercli

thanks

0 Kudos