Add users via script (Win 2000/Server 2003)

By marc.watters ·
I have a large amount of users I need to add to
the local admin group on a collection of
machines running both Win 2000 and Server 2003.
Is there a script that would allow me to do
this? The user accounts already exist within
AD, they are not new users. Any
help/suggestions would be greatly appreciated.
Thank you in advance.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

The Net Group command

by Dumphrey In reply to Add users via script (Win ...

should do the trick. Its able to take input from text files for both a list of computers and users( for /f each in (list.txt) do net group Administrators %%a /add < users.txt [as an example only I havent tried the code]).

Collapse -

Thank you!

by marc.watters In reply to The Net Group command

I will give this a shot and let you know!

Collapse -

Here's how I did it

by marc.watters In reply to The Net Group command

I wrote a batch file, copied it to each
server and ran it. Here is the batch file:

net localgroup administrators DOMAIN\USERNAME
PAUSE ; To check for errors

Some of the users were already members of the
admin group, but the script bypassed the
errors and continued to run. Now I will
attempt to script the functionality of
entering in each user before the rest of the
script runs so the batch file doesn't have to
be edited each time. If I get that working,
I'll post here as well. Thank you for your
guidance and I hope this helps someone else!

Related Discussions

Related Forums