If you are looking for a way to change the root user password in PowerCLI, there are several steps that you can take to accomplish this task. In this article, We will see through the process of changing the ESXi root user password using PowerCLI.
I am on vCenter U2 and ESXi U2
Step 1
First, you will need to start PowerCLI and connect to your ESXi host. You can do this by running the following command in your PowerCLI console:
Connect-VIServer -Server <YourESXiHostName/IPAddress>
Step 2
Set-VMHostAccount -UserAccount root -Password <newPassword>
This will change the root user password to the new password that you have specified.
After you have changed the root user password for ESXi, you can disconnect and re-login from your ESXi host.
Disconnect-VIServer <Your VCSA or ESXi HostName/IPAddress> -Confirm:$false
Now you can log in to your ESXi host with the new password.
Hope this helps!
This is good if you want to change ESXi root password for a few Hosts, What about multiple clusters with X number of hosts?
I will write another post on how we can automate the process of Changing passwords for all the hosts at once.