Hello Everyone,
I am very new to Powershell or even scripting for that matter. We are trying to change the password for a local user account that is disabled for 2000 computers on our domain. When the script starts running it will stop if the computer is offline or network path is not found. I was hoping someone might help me with something along the lines of " If network path not found then skip to next computer on text file"
Here is the script I have so far using Powershell V2.0:
$computers = Get-Content -path C:\users\walter.barrios\desktop\computers2.txt | where {$_ -match "\w+"
} | foreach {$_.trim()}
$username = "XADMINISTRATOR"
$password = "P@ssw0rd12345!"
Foreach($computer in $computers)
{
$user = [adsi]"WinNT://$computer/$username,user"
$user
$user.SetPassword($Password)
$user.SetInfo()
}