I have a script that will change the local administrator account on multiple computers withe a get-content command which works great. But I need to have the script randomize the password on each system and then output the server name and password associated with it, which i cannot even think on where to start. Google has not been my friend with it.
Here is my Script:
$computers = Get-Content -path C:\server.txt
$changeuser = "admin account" $password = Get-Content C:\passwords.txt
Foreach($computer in $computers)
{
echo $computer
$user = [adsi]"WinNT://$computer/$changeuser,user" $user.SetPassword($Password)
$user.SetInfo()
}
Where should I start, do not even know where too.