Powershell Script to reset Local Administrator password RRS feed

  • Question

  • Hi,

    I have a script which is to reset local administrator password of remote machines and I have mentioned the host list in the script.But just would like is there any way, so that we can add line in my script, so that this will reset the administrator password of all machine which is there in a specific set of subnet(example : and in a domain ?

    Can anyone help me with that ?

    $computers = Get-Content -path C:\hosts.txt
    $user = "Administrator"
    $pass = "password1"

    Foreach($computer in $computers)
     $user = [adsi]"WinNT://$computer/$user,user"

    Monday, July 3, 2017 4:15 AM


All replies