local administrator account

  • Thread starter Thread starter jnm125a
  • Start date Start date
J

jnm125a

i would like to create a batch file that wiill add local users and
domain users to the local administrator group on a server, can anyone
help me with this?

jnm
 
i would like to create a batch file that wiill add local users and
domain users to the local administrator group on a server, can anyone
help me with this?

jnm


NewAdmins User1 User2 ... UserN

where each user is either the local UserName or DomainName\UserName

NewAdmins.bat contains:

@echo off
if {%1}=={} @echo Syntax: NewAdmins User1 [User2 ... UserN]&goto :EOF
:loop
if {%1}=={} goto :EOF
@echo net localgroup Administrators %1 /ADD
net localgroup Administrators %1 /ADD
SHIFT
goto :loop

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Hi Jerold Schulman, I copied and pasted your script into a .bat file,
doulbe clicked it and nothing happend. I went into the local
administrators group and it did not put any users in it. What am I
missing to do here??
jnm


Jerold said:
i would like to create a batch file that wiill add local users and
domain users to the local administrator group on a server, can anyone
help me with this?

jnm


NewAdmins User1 User2 ... UserN

where each user is either the local UserName or DomainName\UserName

NewAdmins.bat contains:

@echo off
if {%1}=={} @echo Syntax: NewAdmins User1 [User2 ... UserN]&goto :EOF
:loop
if {%1}=={} goto :EOF
@echo net localgroup Administrators %1 /ADD
net localgroup Administrators %1 /ADD
SHIFT
goto :loop

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Open a CMD.EXE windows and type:

NewAdmins User1 [User2 ... UserN]

Hi Jerold Schulman, I copied and pasted your script into a .bat file,
doulbe clicked it and nothing happend. I went into the local
administrators group and it did not put any users in it. What am I
missing to do here??
jnm


Jerold said:
i would like to create a batch file that wiill add local users and
domain users to the local administrator group on a server, can anyone
help me with this?

jnm


NewAdmins User1 User2 ... UserN

where each user is either the local UserName or DomainName\UserName

NewAdmins.bat contains:

@echo off
if {%1}=={} @echo Syntax: NewAdmins User1 [User2 ... UserN]&goto :EOF
:loop
if {%1}=={} goto :EOF
@echo net localgroup Administrators %1 /ADD
net localgroup Administrators %1 /ADD
SHIFT
goto :loop

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
Back
Top