local administrator account

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
 
J

Jerold Schulman

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
 
J

jnm125a

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
 
J

Jerold Schulman

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
 

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