Re: Admin Password
From: Mike (mikef2691_at_comcast.net)
Date: 10/02/04
- Next message: Mike D: "Updating Windows 2000 Client Computer For 2003"
- Previous message: bkeneu: "Re: kill multiple processes and delete 1/2 files if they exist"
- Next in thread: S. Sam: "Re: Admin Password"
- Reply: S. Sam: "Re: Admin Password"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 2 Oct 2004 18:40:51 -0500
Sam,
When in doubt follow Torgeir advice. That being said, here is a script from
WindowsITPro magazine that does what you want.
::__________________________________________Begin Bat file
_________________________________________________
@ECHO OFF
@Title Password Change Script
SETLOCAL
:: Set the location of the server input list. Put one server per line.
:: Separate servername, Administrator account name and Password with commas.
:: Spaces in the path are allowed.
SET ServerList=D:\AdminPasswordChanger\ServerList.csv
:: Set the location of the output file. Spaces in the path are allowed.
SET Outputfile=D:\AdminPasswordChanger\PWlog.csv
:: Set the location of the Pspasswd tool. Spaces in the path are OK with the
Pspasswd tool.
SET PspasswdLoc=\\Server1\PSTools\pspasswd.exe
:: Set the location of the Local tool. - No spaces in the path are allowed
with the Local tool.
SET LocalLoc=\\Server1\Reskit\local.exe
:: ******* Configuration should not be needed below this point *******
If /I '%1'=='-Change' ECHO This script is about to change the passwords in
the input list you have specified. If you want to launch the script in a
check mode remove the -Change argument.&Set Change=1&PAUSE
If /I NOT '%1'=='-Change' ECHO This script is about to check the passwords
in the input list you have specified. No passwords will be changed - only
checked. If you want to launch the script in a mode to change the passwords
use the -Change argument.&Set Change=0&PAUSE
ECHO %DATE%>"%Outputfile%"
ECHO %TIME%>>"%Outputfile%"
ECHO.>>"%Outputfile%"
If "%Change%"=="1" ECHO Script Run in PW Change Mode>>"%Outputfile%"
If "%Change%"=="0" ECHO Script Run in PW Check Mode - No passwords were
changed>>"%Outputfile%"
ECHO.>>"%Outputfile%"
ECHO Servername,Admin Acct Name,PW,Result>>"%Outputfile%"
for /f "tokens=1,2,3 usebackq delims=," %%i in ("%ServerList%") do (SET
Server=%%i) & (SET AdminName=%%j) & (SET Password=%%k) & (CALL :pingit)
ENDLOCAL
ECHO Run complete! View Outputfile for results.
GOTO :EOF
:: Ping server to see if it is on and log error if offline.
:pingit
ECHO Contacting %Server%
FOR /F "tokens=1" %%i in ('ping -n 1 -w 5000 %Server% ^| find "Reply"') DO
(Call :PWChange) & (GOTO :skip)
ECHO %Server%,N/A,N/A,Offline!>>"%Outputfile%"
ECHO %Server% Offline!
:skip
GOTO :EOF
:: Attempt PW change on server and log error if change fails.
:PWChange
If "%Change%"=="1" For /F "tokens=*" %%i in ('"%PspasswdLoc%" \\%Server%
%AdminName% %Password%') do ECHO %Server%,%AdminName%,"%Password%",PW Change
Success,>>"%Outputfile%"&GOTO :last
If "%Change%"=="0" NET USE \\%Server%\IPC$ /D >NUL 2>NUL
If "%Change%"=="0" NET USE \\%Server%\IPC$ "%Password%"
/USER:%Server%\%AdminName%&& ECHO %Server%,%AdminName%,%Password%,PW Checked
and Confirmed>>"%Outputfile%" && GOTO :last
SET Aname=
For /F "tokens=*" %%i in ('%LocalLoc% Administrators \\%Server% ^| Find /I
"\%AdminName%"') do (SET Aname=%%i)
If Not Defined Aname ECHO %Server%,%AdminName%,N/A,User account not
found>>"%Outputfile%"&GOTO :last
ECHO %Server%,%AdminName%,%Password%,PW Check/Change Failure>>"%Outputfile%"
:last
GOTO :EOF
::-- end Bat File
---------------------------------------------------------------------
"Are you still wasting your time with spam?...
There is a solution!"
Protected by GIANT Company's Spam Inspector
The most powerful anti-spam software available.
http://mail.spaminspector.com
"Sam" <sam.security@link.net> wrote in message
news:eWLmDDVoEHA.2588@TK2MSFTNGP12.phx.gbl...
Dear Mark,
I downloaded Pspasswd from
(http://www.sysinternals.com/ntw2k/freeware/pspasswd.shtml)
but after I checked the parameters of the command I felt that I need to ask
anyone use it before. So now I have a domain controller and 200 PCs so how I
use Pspasswd to change the Admin Password for the local computers without
any mistakes.
Thanks
"Mark-Allen Perry" <mark-allen@mvps_dot_org> wrote in message
news:#jfQExUoEHA.800@TK2MSFTNGP14.phx.gbl...
And also: http://www.sysinternals.com/ntw2k/freeware/pspasswd.shtml
-- And always try the MS KB first before posting. The answer is probably already posted. MS KB: http://support.microsoft.com/default.aspx?scid=fh;EN-US;KBHOWTO ---- Mark-Allen Perry ALPHA Systems Marly, Switzerland mark-allen_AT_mvps_DOT_org "Sam" <sam.security@link.net> wrote in message news:e%23%23p1sToEHA.2588@TK2MSFTNGP12.phx.gbl... Please I need some help, I would like to change the Admin Password for all local computers so is there any way to let me do it? Is there any scripts that let me do it or any one used any 3rd party software for this issue? Thanks
- Next message: Mike D: "Updating Windows 2000 Client Computer For 2003"
- Previous message: bkeneu: "Re: kill multiple processes and delete 1/2 files if they exist"
- Next in thread: S. Sam: "Re: Admin Password"
- Reply: S. Sam: "Re: Admin Password"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|