script

S

santosh

can anybudy help me out...

i want to rename all local machines administrator
account,reset the password of that account and want to add
a new user with administrator privielages of local
administrator.

can it be done by group policy
or script
 
M

mark

check into the cusrmgr utility in the resource kit for modifying passwords
and removing users from a local account.
you should be able to use the addusers utility (also from the RK) to create
local user accounts.
I had to change all local admin passwords for our company, and I used this
process. took about 15 minutes per time, and about 4 times (different days)
to get all the systems finished.

I extracted a list of computer names from AD and put into a file called
nopingReply.txt, then ran this batch file against it.
when the process finished, I had a list of systems that were successful, and
a list of systems that I couldn't access. I renamed compsbad to nopingreply
and ran every day until I was fairly confident I got 'em all. The errors
file told me which systems I had to go back and manually take care of, and
sometimes it indicated the users were messing around with the local accounts
and removing domain admins from the administrators group.
Hope this helps
Mark


echo off
copy nopingreply.txt complist.txt

:Repeat
echo processing next name
set ComputerName=
for /f "eol=; tokens=1*" %%i in (Complist.txt) do set computername=%%i
if %computername%"==" goto ender
ping -n 1 %computername%|find/i"reply"
if errorlevel 1 goto BadPing
if errorlevel 0 goto ProcessAdmin

:next
echo processing list
type complist.txt| find /v "%computername%">complist1.txt
copy complist1.txt complist.txt
goto repeat

:BadPing
echo %computername%>>compsbad.txt
goto next

:processAdmin
echo processing local admin change on %computername%>>Completed.txt
cusrmgr -u Administrator -m \\%computername% -P
yourpasswordhere|find/i"error"
if errorlevel 1 goto next
echo Didn't like %computername%
if errorlevel 0 echo Problem with resetting %computername%>>Errors.txt
goto next

:ender
del complist.txt
del complist1.txt
pause
 

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