PowerShell PowerCLI Get-VIPermission
This was created to review current status of local accounts and
check the creation of a local backup accounts on our ESXi hosts.
#Connects to ESXi Host
Connect-VIServer -server $Servername -Protocol https -user root -Password "MyPassword"
#Gets a Role Permissions for account root
Write-Output "User Account Permissions / Role"
Get-VIPermission -Principal root | Select Principal, Role
#Gets a List of Roles on ESXi Host
Write-Output "List of Permissions / Roles"
Get-VIRole | Select Name | Format-List
#Gets list of Local Accounts on ESXi
Write-Output "List of Local Accounts"
Get-VMHostAccount | Select Name | Format-List
Disconnect-VIServer $Servername -Confirm:$False