Change Local Account Password
Usually, administrators using same password on all servers for easier management and there is some security reasons to change the password periodically such as defining an expire time for password or when one of members is left company.
Changing user’s password or many users password on a single host is too easy but what about more than host?
You know, VMware has provided some automation tools such as PowerCLI. The automation tools will help administrators to do their tasks much easier and faster than GUI.
In this post, you’ll find a simple solution for changing multiple users password on multiple ESXi hosts.
The below script will help you to change a user account’s password on multiple ESXi servers:
#A List of ESXi Servers IP Addresses
$VMHosts="ESXi1 IP/DNS Name","ESXi2 IP/DNS Name",...,"ESXiN IP/DNS Name"
#Get Administrator Credential
Read-Host "Press Enter To Continue..."
#Get The User That His Password Must be Changed
$User= Read-Host "Enter Username"
#Get The User's Password (The User That His Password Must be Changed)
$Password = Read-Host "Enter Password" -AsSecureString
Foreach ($VMHost In $VMHosts)
#Connect To ESXi Server by The Credential
Connect-VIServer -Protocol https -Server $VMHost -Credential $Credential
#Change User Account's Password
Set-VMHostAccount -UserAccount $User -Password $Password
#Disconnect from ESXi Server
Disconnect-VIServer $VMHOst -Confirm:$false
I’ll publish another script to change multiple accounts password with multiple passwords on multiple ESXi servers.
Read More on Teimouri.net
8,001 total views, 10 views today