Question Locked

change the local administrator password on the network

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

hi
we have about 2000 client and we are going to change the password of local administrator,how can we do that with script or group policy or ...?
best regards.

4 replies

by babydrum2003

This one works for me. It does it based on OU so if your computers are in different OU's then you'll need to modify it.

Set objOU = GetObject("LDAP://OU=Computers, DC=companyname, DC=com")
objOU.Filter = Array("Computer")
Set objNetwork = CreateObject("WScript.Network")

On Error Resume Next

For Each objItem in objOU

strComputer = objItem.CN
Wscript.Echo objItem.cn
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator, user")

objUser.SetPassword "typenewpasswordhere"
objUser.SetInfo
Next

by bryan.dylan

I made the necessary changes to the script for the LDAP setting and when I run the script nothing happens. Correct me if I am wrong, but this is a vbs script isn't it? Thanks for your help!

This discussion is closed to new replies.