Skip navigation

Q. What PowerCLI commands can I use to create a user account on an ESXi host?

A. While most of us rarely need additional user accounts in ESXi, there occasionally comes the time to create one. You can easily create new user accounts using VMware's vSphere PowerCLI Windows PowerShell interface. Once inside the PowerCLI interface and connected to an ESXi host, the following command will create a new user and assign that user to the localadmin and root groups:

New-VMHostAccount -Id gshields -password PassW0rd -Description "SpecialUser" -AssignGroups localadmin,root

You can view a list of information about any ESXi user with the command

Get-VMHostAccount -User gshields | fl *

You can assign permissions to an existing user with the New-VIPermission cmdlet:

New-VIPermission -Role admin -Principal gshields -Entity server1.company.pri
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish