Re: Can I add myself to Administrators group of all PCs when I log

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mungo Bulge (NO.SPAM_at_hotmail.com)
Date: 02/16/05


Date: Wed, 16 Feb 2005 13:42:15 -0500

This is what we do to solve this problem.
This is a bat file we run on all workstations to facilitate the same
requirements.

CLS
@echo off
@echo Choose the domain for this PC from the menu below...
@echo .
@echo .
@echo 1. ADM HR
@echo 2. ADMST
@echo 3. CMS
@echo 4. CRS
@echo 5. CSP
@echo 6. DCDS
@echo 7. DISO
@echo 8. Fin CS
@echo 9. MAT(Lstl Domain)
@echo A. CMJ
@Echo B. CFEWC
@echo .
@echo 0. Exit
@echo .

choice /c123456789AB0 Please enter your choice...

if errorlevel = 12 goto end
if errorlevel = 11 goto CFEWC
if errorlevel = 10 goto CMJ
If errorlevel = 9 goto MAT
if errorlevel = 8 goto fincs
if errorlevel = 7 goto diso
if errorlevel = 6 goto dcds
if errorlevel = 5 goto csp
if errorlevel = 4 goto crs
if errorlevel = 3 goto cms
if errorlevel = 2 goto admst
if errorlevel = 1 goto ADMhr

:CFEWC
Echo Setting up for CFEWC domain.
pause
net localgroup administrators "CFEWC\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\CFEWCsrvadm" /add > nul
net localgroup administrators "ndhq\CFEWCpcadm" /add > nul
goto common

:CMJ
Echo Setting up for CMJ domain.
pause
net localgroup administrators "ADMHR\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\cmjsrvadm" /add > nul
net localgroup administrators "ndhq\cmjpcadm" /add > nul
goto common

:ADMHR
Echo Setting up for ADM(HR) domain.
pause
net localgroup administrators "ADMHR\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\admhrsrvadm" /add > nul
net localgroup administrators "ndhq\admhrpcadm" /add > nul
goto common

:mat
Echo Setting up for ADM(MAT)-LSTL domain.
pause
net localgroup administrators "LSTL\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\admmatsrvadm" /add > nul
net localgroup administrators "ndhq\admmatpcadm" /add > nul
goto common

:diso
Echo Setting up for DISO domain.
pause
net localgroup administrators "diso\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\disosrvadm" /add > nul
net localgroup administrators "ndhq\disopcadm" /add > nul
goto common

:dcds
Echo Setting up for DCDS domain.
pause
net localgroup administrators "dcds\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\dcdssrvadm" /add > nul
net localgroup administrators "ndhq\dcdspcadm" /add > nul
goto common

:crs
Echo Setting up for CRS domain.
pause
net localgroup administrators "crs\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\crssrvadm" /add > nul
net localgroup administrators "ndhq\crspcadm" /add > nul
goto common

:csp
Echo Setting up for CSP domain.
pause
net localgroup administrators "csp\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\cspsrvadm" /add > nul
net localgroup administrators "ndhq\csppcadm" /add > nul
goto common

:cms
Echo Setting up for CMS domain.
pause
net localgroup administrators "cms\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\cmssrvadm" /add > nul
net localgroup administrators "ndhq\cmspcadm" /add > nul
goto common

:admst
Echo Setting up for ADMST domain.
pause
net localgroup administrators "admst\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\admstsrvadm" /add > nul
net localgroup administrators "ndhq\admstpcadm" /add > nul
goto common

:fincs
Echo Setting up for ADM Fin CS domain.
pause
net localgroup administrators "admfincs\domain admins" /add > nul
net localgroup administrators "ndhq\baseline managers" /add > nul
net localgroup administrators "ndhq\cmt" /add > nul
net localgroup administrators "ndhq\helpdesk" /add > nul
net localgroup administrators "ndhq\csp sms access" /add > nul
net localgroup administrators "ndhq\admfincssrvadm" /add > nul
net localgroup administrators "ndhq\admfincspcadm" /add > nul
goto common

:common
rem c:\winnt\System32\rundll32.exe setupapi,InstallHinfSection
DefaultInstall 132 c:\ntconfig.inf
del c:\ntconfig.inf
CACLS "C:\Documents and Settings\All Users\Application
Data\Microsoft\Media Index" /T /E /G EVERYONE:F > nul
rem c:\winnt\system32\cmd.exe /c rmdir c:\drivers /s /q

:end



Relevant Pages

  • Re: Batch file help
    ... copy file1.txt f:\file2.txt 1> NUL ... On win2K if I have an error, such as not enough room on f:, ... @echo off ... echo Insufficient space on drive F:. ...
    (microsoft.public.windowsxp.general)
  • Re: Small Simple VBscript Problem - Adding Users to Local Group
    ... I can't echo the ObjUser because it is having trouble binding. ... getting this simple vbscript to work. ... WshShell.Run "cmd.exe /c net localgroup administrators MyDomain ...
    (microsoft.public.windows.server.scripting)
  • I truly believe good people are the ones who do not accuse
    ... :: The version we download here is a PKZIP ... echo close #1>> ~test.bas ... del ~test.bas> nul ... echo DO NOT close this window. ...
    (sci.math)
  • Re: find -print0 confusing me
    ... echo "straight call to find" ... echo "calling in backquotes" ... The NUL byte is the string terminator. ...
    (comp.unix.shell)
  • Re: Batch file help
    ... On win2K if I have an error, such as not enough room on f:, ... to NUL:. ... @echo off ... echo Insufficient space on drive F:. ...
    (microsoft.public.windowsxp.general)