Hi,
This is not a complete “ready to use” script – it should only give you a basic idea/overview, which commands you can use to perform the necessary steps
Connect-VIServer -Protocol https -Server <FQDN_or_IP_of_VMHost> -User root -Password “your_password”
New-VMHostAccount -Id -Password “your_new_password” -Description <description_of_the_user>
New-VIRole -Name <your_role_name> -Privilege “eg: Settings”
New-VIPermission -Entity <FQDN_or_IP_of_VMhost> -Principal <account_name> -Role “<your_role_name>” -Propagate:$true
1.command: will connect you to your ESXi host
2.command: will add a new local user
3.command: will add a new role with dedicated permissions. In the example above the permission “Global” – “Settings”
4.command: will assign the new role to the new user