How to reset root password ESXi version 7? If anyone know how only the way. Please share
Hello, officially is you lost the root password you have to reinstall.
Unofficially you can try this:
https://www.vmwareblog.org/forgot-esxi-root-password-no-problems-4-ways-reset/
If you have vCenter and the correct license you can use Host Profiles to reset the root password.
Reset ESXi Root Password with Host Profile (68079) (vmware.com)
I think, there is a much easier way, that isn't linked yet.
If the ESXi is registered to vCenter, you can use PowerCLI together with esxcli to reset the password.
You can also use this script to change the root password periodically
#Connect to vCenter
Connect-VIServer <vcenter-name>
#Connect to esxcli
$esxcli = Get-EsxCli -VMhost <esxi-host-name> -V2
#Define new password for root
$arg = $esxcli.system.account.set.CreateArgs()
$arg.id = ‘root’
$arg.password = ‘NewPassword’
$arg.passwordconfirmation = $arg.password
#Set new password
$esxcli.system.account.set.Invoke($arg)
Great info.
Excellent, that technique is great. Thank you.
Can you send me a How-to-Do for your script. I don't work so often with the PowerCli.
Thanks Manuel
Use Power shell ISE to create the script
You just need to copy and paste the script and change some values
#THIS SCRIPT MUST BE EDITED AS SHOWN IN THE EXAMPLES
#Connect to vCenter ip or hostname
#Example Connect-VIServer 10.60.x.xxx
Connect-VIServer <vcenter-name>
#Connect to esxcli you must specify hosname
#Example $esxcli = Get-EsxCli -VMhost esx1.lab.com -V2
$esxcli = Get-EsxCli -VMhost <esxi-host-name> -V2
#Define new password for root
#Example $arg.password = ‘Changeme!'
$arg = $esxcli.system.account.set.CreateArgs()
$arg.id = ‘root’
$arg.password = ‘NewPassword’
$arg.passwordconfirmation = $arg.password
#Set new password leave this as default
$esxcli.system.account.set.Invoke($arg)