VMware Cloud Community
damiankarlson
Enthusiast
Enthusiast

Changing ESXi default root password

I've got a PowerCLI script that takes a fresh install of ESXi and configures vSwitches/portgroups/NFS storage, etc. However, I've noticed that when I change root's default password via Set-VMHostAccount, the fact that I've changed the password isn't reflected in vCenter. What am I missing?

Twitter: @sixfootdad Blog: damiankarlson.com Podcast: professionalvmware.com/brownbags
0 Kudos
3 Replies
damiankarlson
Enthusiast
Enthusiast

I rebooted it and the alarm went away. Is there another way to do it without a reboot?

Twitter: @sixfootdad Blog: damiankarlson.com Podcast: professionalvmware.com/brownbags
0 Kudos
LucD
Leadership
Leadership

From your description it looks as if it's the vCenter agent that had problems with the password change.

You could try a Remove-VMHost followed by an Add-VMHost.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

damiankarlson
Enthusiast
Enthusiast

I just wasn't patient enough. vCenter catches up just fine.

#Connect directly to ESXi server and change root password to user-specified
Connect-VIServer esxhost.domain.com -User root -Password ""
$password = Read-Host ("Please enter a new password for root:")
Set-VMHostAccount -UserAccount root -Password $password

Twitter: @sixfootdad Blog: damiankarlson.com Podcast: professionalvmware.com/brownbags
0 Kudos