How To: Change root user password in PowerCLI.

Published on
7,333 Points
1 Endorsement
Last Modified:
Never give up - The effort and daily dedication make a person a winner
The short tutorial provides step by step instructions on how to change the password of the Root user by using Vmware PowerCLI.

I hope you find it very useful.


First of all, let's define what is meant by the "Root" user in VMware.

The Root user is just the default user that is used when we start an installation of VMware ESXi on a physical server, to which we set a password to.

When a password change is required to the user referred as "Root", then the traditional way of achieving that task is by connecting directly to the ESXi, or via the VSphere client.

Imagine that you want to make the password change, as can be done by using either of the two methods mentioned above, but you may prefer to use a Command Line Interface to change the password instead. That can be done by using the VMware VSphere PowerCLI command line tool, which is very useful for this type of task and a whole lot more.

The article describes step by step instructions on how to change the password of the Root user, to another password that you, as an administrator may want to use, by using the arguably quicker PowerCLI method.

Changing the root user password using PowerCLI


Click on the VMware VSphere PowerCLI icon.


The VMware Vsphere PowerCLI black interface is displayed.


Enter Connect-VIServer and press Enter

Enter the name of the ESXi host - (esx-03a.corp.local) in the example below, and press Enter twice.


Enter the root user's credentials to authenticate to the ESXi Host.


Note the following display confirming the credentials entered were correct.


Enter the following command:

      Set-VMHostAccount -UserAccount root -Password (Enter your New password). Do not include parentheses ()


The resulting display shows that the password change was successfully completed.

Congratulations, the password has now been changed.

I hope you found this short tutorial useful and that you can apply it to your work activities in a virtual environment.

Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Get 7 days free