Changing local admin password, domain wide

S

Steve

Is there a way to change the local admin password for
every machine in the domain without having to go to each
one individually.
 
J

Johan Arwidmark

You can do it using a script and the net user command....
In this example i have used the psexec.exe tool from sysinternals
(freeware) to launch net user remotely (you of course need to be
domain admin to run this...)

In the below example I assume that the computer accounts are in the
Sales OU and that psexec.exe file is in the os path.

**********************

Set objShell = WScript.CreateObject("WScript.Shell")

Set objOU = Getobject("LDAP://ou=Sales,dc=lcab,dc=net")

For each obj in objOU

strSetPassword = "psexec \\" & obj.cn & " net user
Administrator P@ssw0rd"
Set objSetPassword = objShell.exec(strSetPassword)

Next

*************************


regards
Johan Arwidmark

Windows User Group - Nordic
http://www.wug-nordic.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top