PowerShell: Add account and assign role on VMWare ESXi host

 

#========================================
Connect-VIServer -Protocol https -Server FQDN_or_IP_of_VMhost -User root -Password ********
New-VMHostAccount -Id Account_Name -Password ******** -Description 'Created by Mad Serg YYYY-MM-DD'
New-VIPermission -Entity FQDN_or_IP_of_VMhost -Principal Account_Name -Role Admin -Propagate:$true
#========================================

Source

Advertisements