I found the below PowerShell script which reads the hostname of servers from a text file and sets the provided password on all servers.
$computers = Get-Content -path C:\computers_list.txt
$user = "Administrator"
$pass = "Password"
Foreach($computer in $computers)
$user = [adsi]"WinNT://$computer/$user,user"
However, I want to set a different password for each server. So I need to modify the script to do so.
For example, to include the password in the text file next to each hostname, separated with comma. Or to have one text file with hostnames and one text file with passwords.
Can anybody help?