Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modiying group membership in bulk

Status
Not open for further replies.

beefstew

Technical User
Oct 27, 2002
124
GB
Hi,

I have an Excel spreadsheet with around 1500 user names/logon names that I need to assign to a specific group. Can someone please let me know how I can do this without actually modifying each user account one by one?

Thanks in advance,

Beef
 
U can use the net group command to do this.
Using your Excel Spread sheet place these in the following columns:
A - NET GROUP
B - "group name" - the name of the security group
C - SAM Account of the user. Just copy from the 1500 you have.
D - /ADD

Your excel spread sheet should have 1500 entries similar to this:
NET GROUP FILESHAREREAD jdoe /ADD
NET GROUP FILESHAREREAD tlin /ADD
NET GROUP FILESHAREREAD ltom /ADD
and so on...

Next save your Excel spread sheet as a comma delimited .csv file. Open the file in wordpad or notepad. I prefer wordpad because it is multi-threaded which will be quiker in doing the next step.

From Wordpad, under the Edit menu, choose replace. In Find what: type in a comma (,). In the Replace with: type the space bar. Hit the Replace All button which will remove the "," and replace with " " (without the quotes of course).

The file should go from:
NET GROUP, FILESHAREREAD, jdoe, /ADD,
To:
NET GROUP FILESHAREREAD jdoe /ADD
For all 1500 entries (be patient).

Select All and Copy. Open a command prompt - right click paste. Away you go...

FYI: the NET GROUP command is required to be run on a domain controller.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top