Click here to Skip to main content
13,594,513 members
Click here to Skip to main content
Add your own
alternative version


37 bookmarked
Posted 22 Dec 2004

Updating Windows Security Groups using VB.NET and Directory Services

, 22 Dec 2004
Rate this:
Please Sign up or sign in to vote.
How to use directory services to manage group level security. Easily Add, Remove and List users in a Windows domain security group. Note: You must be a Domain Admin to use this code.


Do you use Integrated Windows Security to manage permissions in your applications and or databases? The class AD_Group.vb provided in this sample project will let you easily Add, Remove and List users in a Windows group. My development group uses group security in our ASP.NET applications using the User.IsInRole ("Domain\Group") function all the time. We also set permissions to our web directories at the group level. Now we manage our groups easily with VB.NET code. It's a lot quicker than logging on to our DC server and using the Active Directory GUI provided in Windows Server 2000. The Windows application pictured below is one way I put the AD_Group.vb class to good use.

To use this code, add a reference to the DirectoryServices.dll:

After your reference has been added, simply Add Existing Item to your project. Add the AD_Group.vb file contained in this sample project like so:

Then you can call the code like this:

Dim Obj AsNew AD_Group(MyDomain, MyServer, MyGroup)

That's basically it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
Todd is currently working at PA Lumbermens as a .net programmer.

You may also be interested in...


Comments and Discussions

Generalwindows authentication Pin
BMWABCD18-Jan-07 11:07
memberBMWABCD18-Jan-07 11:07 
Questionfinding Domain Name, Server Name & Group Name Pin
Jwalant Natvarlal Soneji21-Dec-05 18:56
memberJwalant Natvarlal Soneji21-Dec-05 18:56 
Generalaccess denied Pin
firstmaster27-Oct-05 15:56
memberfirstmaster27-Oct-05 15:56 
GeneralRe: access denied Pin
ToddHileHoffer29-Oct-05 14:35
memberToddHileHoffer29-Oct-05 14:35 
GeneralSecurity Pin
Pradeep Panzade20-Feb-05 18:04
memberPradeep Panzade20-Feb-05 18:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04-2016 | 2.8.180621.3 | Last Updated 22 Dec 2004
Article Copyright 2004 by spidur1
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid