Mass Domain Password Changing

  • Thread starter Thread starter M. Johnston
  • Start date Start date
M

M. Johnston

I'm trying to find an easy way to change all the passwords
for each local administrator account for each computer on
my domain. Does anyone have any suggestions? I've found a
few complicated scripts that do it, but I would like
something that keeps a report of the machines that have
been changed and a list of errors to those who have not.
Or something similar to this. Much thanks in advance!

M.
 
I'm trying to find an easy way to change all the passwords
for each local administrator account for each computer on
my domain. Does anyone have any suggestions? I've found a
few complicated scripts that do it, but I would like
something that keeps a report of the machines that have
been changed and a list of errors to those who have not.
Or something similar to this. Much thanks in advance!

M.


See tip 199 in the 'Tips & Tricks' at http://www.jsiinc.com

You could also do the following, using Rsoon freeware from tip 2395 in the 'Tips
& Tricks' at http://www.jsiinc.com

setlocal
@echo.>password.log
set ndc=netdom query /domain:YourDomainName
for /f "Skip=1 Tokens=*" %%w in ('%ndc% WORKSTATION') do set cn=%%w&call :ws
for /f "Skip=1 Tokens=*" %%w in ('%ndc% SERVER') do set cn=%%w&call :ws
for /f "Skip=1 Tokens=*" %%w in ('%ndc% DC') do set cn=%%w&call :ws
endlocal
goto :EOF
:ws
ping -n 1 %cn%>nul
if %ERRORLEVEL% NEQ 0 goto wsdown
rsoon "\\%cn%" 125 "cmd /c net user Administrator TheNewPassword">nul 2>&1
@echo %cn% password changed>>password.log
goto :EOF
:wsdown
@echo %cn% not available>>password.log


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Will this work if the person who uses this script isn't
an administrator? Or is this something that you wouldn't
put in a login script? Sorry for the silly qustions...
 

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

Back
Top