Help!  Need to Add user or global group to workstation's local group

Posted on 2003-03-17
Medium Priority
Last Modified: 2010-05-01
OK, I can find examples of how to use NetGroupAddUser to add a user to a global group on our NT Domain, but what I need to do is be able to add a user or global group to the local group on a workstation. . .

To make a long story short,  We've restructured our organization and added a new support group, and created a new Global Group for them in our NT Domain.  Now we want to add that global group into the Administrator's group on the 700 workstations this new group supports, so those I.T. staff can support the workstations properly.  *Note, Windows 2000 and NT4 workstations both.

I've re-worked an existing app of mine to show each workstation in the domains they support, and list the members of the administrators group.  This was so we could determine which machines had and didn't have that group in Administrators.  I'm running this app from my administrative workstation.  I want to be able to implement code to add the new group to the remote computer with a click of a button, so if some code examples could be provided that allow me to choose a remote computer (ie: \\servername) instead of just local.  

I really don't want to have to visit 700 machines individually . . .

Any help appreciated, thanks all!
Question by:AlbertaBeef
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 28

Accepted Solution

vinnyd79 earned 400 total points
ID: 8168294
check out this link and look at the code page:


Look for the example called "wks" and see if it can help.
LVL 13

Author Comment

ID: 8169245
Found what I needed after pouring through LOTS of code, and modifying it for my purposes.

Lots of code, lol.

Amazingly enough I thought I looked at the vbadmincode page, as well as the other ones I frequent.  Not sure how I missed it . . .

that Wks project is fairly large.  Slow as a dog in our agency, mine is much faster although not as detailed.

Thanks for the help,

Expert Comment

ID: 30807016
Hi vinnyd79

Even i am searching for the same code.

The Link does not open is it the correct code.
Can you mail me the code.

Thanks & Regards

Pranav Parab


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question