Last post Sep 11, 2014 09:25 AM by smirnov
Sep 08, 2014 06:24 PM|wendy elizabeth|LINK
In an existing vb.net 2010 web form application, I am going to add an web interface for a user to be able to do the following:
1. See what users are assigned to 5 specific active directory groups, and
2. allow the user to update the active directory groups.
Thus can you show me and/or point me to a url that shows me example code on how to allow users to set the active directory groups and to update the active directory groups through the web interface?
Sep 08, 2014 11:12 PM|May Wang|LINK
Thanks for posting here.
Based on your description, you want to get a link with example code to help you with processing active directory groups through web interface.
As far as I know, there are three interfaces for accessing the Active Directory:
1) LDAP: The Lightweight Directory Access Protocol (LDAP) is the service protocol that runs on a layer above the TCP/IP layer (or stack) and provides an interface for accessing, searching and modifying Internet Directories, and is based on a client-server
2) ADSI: The Active Directory Services Interface (ADSI) is a set of COM components (or Interfaces) designed to access the directory services from different network providers in a network setup, it is designed to provide a single, central interface for accessing
& managing network resources.
3) System.DirectoryServices: The System.DirectoryServices Namespace is built into the .Net Framework designed to provide programming access to LDAP directories (Active Directory) and is built on the ASDI API.
More about these interfaces introduction and usage please refer to the links below.
Working with Active Directory in VB.NET (There is sample code in this link)
http://www.dreamincode.net/forums/topic/30894-working-with-the-active-directory-in-vbnet/ (There is sample code in this link)
vb.net allow user to update active directory group (There is a
lot of useful resources in this link)
Sep 09, 2014 11:25 AM|wendy elizabeth|LINK
From your reply, do you think that I should use the 'System.DirectoryServices'? This will 1 or 2 admin users that will be able to change the rights various users have access to.
Sep 11, 2014 09:25 AM|smirnov|LINK
You need to search this forum, there are many similar questions which were answered already.
Dim PC As New PrincipalContext(ContextType.Domain)
Dim GP As GroupPrincipal = GroupPrincipal.FindByIdentity(PC, groupName)
Dim P As Principal
For Each (P in GP.Members)
Also see MSDN