• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Script or Batch file to load Administrators in XP

T. Eynon

OSNN One Post Wonder
#1
Does anyone know how to create a batch or script file for loading users into the Local Groups Adminstrator folder of an XP PC. We have about 150 users that we would like to make administrators on for several test PCs and would like to do this with a batch or script file. If anyone knows how to do this please reply back with the syntax to place in the batch or script file.

Thanks
 

fitz

Woah.. I'm still here?
Staff member
Political User
#2
You could use a GPO and setup "restricted groups" specifically if you are running active directory.

If you really need a script, i could probably whip something up fairly quickly.
 

T. Eynon

OSNN One Post Wonder
#3
Thanks Fitz for the advice on the GP0. I was hoping not to have to involve my networking team.

I did find something with the following syntax but was not able to get it to work. It was for Windows 2000.

I really don't need to load users into a specific group like the last line shows all I really want to do is load them as an administrator in the administrators group file.

I was hoping to have a user be able to loads these admins by running a .bat file.

Thanks. Tim

Code found:

Net Localgroup Administrators

"Domain_Name\Developer1" /Add

Net Localgroup Administrators

"Domain_Name\Developer2" /Add

Net Localgroup Administrators

"Domain_Name\Developer3" /Add

Net Localgroup Administrators

"Domain_Name\Developer4" /Add

Net Localgroup Administrators

"Domain_Name\Developer5" /Add

And use

Net Localgroup Administrators

"Domain_Name\Developers_Group"

/Add
 

fitz

Woah.. I'm still here?
Staff member
Political User
#4
that code should work on XP also.. but it looks like you have the synax a little mixed up..

The commands should also be on the same line:

Code:
net localgroup administrators /add %domain%\%user%
Understand, in order to add to the administrator group, the batch file needs to be run as an administrator.
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,960
Messages
673,237
Members
89,011
Latest member
grovo_test