Answered by:
Querying Active Directory with VB.NET

Question
-
Good morning
I have a desire (not yet a need) to build some method of query a particular node in Active Directory, in order to find out which groups each member user of that node is a member of.
Ultimately, the driver behind this is delegation: we run a system here which uses a central database for the granting of access to systems. I want to be in a position where a user's access to systems is controlled through membership of Active Directory groups, meaning that the access can be granted when the user's account is created or amended.
I'm aware that I may have put this in the wrong category, in which case I humbly issue a newbie apology.
TIA
Ian Henderson
Thursday, April 19, 2012 10:24 AM
Answers
-
The webpage below has C# code for doing this. It uses the Net libraries System.DirectoryServices and System.Security.Principal
http://msdn.microsoft.com/en-us/library/ms180890(v=vs.90).aspx
Here is some VB code for reading lists
http://msdn.microsoft.com/en-us/library/ms450301.aspx
This VB code reads list items
http://msdn.microsoft.com/en-us/library/ms429658.aspx
Here is some VB code for getting system.Security.Class
http://msdn.microsoft.com/en-us/library/system.security.principal.genericprincipal.aspx
jdweng
- Marked as answer by Lie You Thursday, April 26, 2012 3:11 AM
Thursday, April 19, 2012 12:53 PM -
Hi,
Also
Here is very useful library from codeplex
http://linqtoldap.codeplex.com/
If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".
- Marked as answer by Lie You Thursday, April 26, 2012 3:11 AM
Thursday, April 19, 2012 4:05 PM -
Hello,
Please check out the link below. It will help you.
http://www.codeproject.com/Articles/19689/Working-with-Active-Directory-in-VB-NET
http://vijirajkumar.blogspot.com/2009/12/active-directory-using-vbnet.html
- Marked as answer by Lie You Thursday, April 26, 2012 3:11 AM
Friday, April 20, 2012 8:13 AM -
Hi Ian,
Please check, one sample code is given here:
http://www.codeproject.com/Articles/19689/Working-with-Active-Directory-in-VB-NET
And another very good post is here:
http://vijirajkumar.blogspot.in/2009/12/active-directory-using-vbnet.html
Regards, http://shwetamannjain.blogspot.com
- Proposed as answer by Shweta Jain (Lodha) Sunday, April 22, 2012 2:36 AM
- Marked as answer by Lie You Thursday, April 26, 2012 3:11 AM
Sunday, April 22, 2012 2:36 AM
All replies
-
The webpage below has C# code for doing this. It uses the Net libraries System.DirectoryServices and System.Security.Principal
http://msdn.microsoft.com/en-us/library/ms180890(v=vs.90).aspx
Here is some VB code for reading lists
http://msdn.microsoft.com/en-us/library/ms450301.aspx
This VB code reads list items
http://msdn.microsoft.com/en-us/library/ms429658.aspx
Here is some VB code for getting system.Security.Class
http://msdn.microsoft.com/en-us/library/system.security.principal.genericprincipal.aspx
jdweng
- Marked as answer by Lie You Thursday, April 26, 2012 3:11 AM
Thursday, April 19, 2012 12:53 PM -
Hi,
Also
Here is very useful library from codeplex
http://linqtoldap.codeplex.com/
If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".
- Marked as answer by Lie You Thursday, April 26, 2012 3:11 AM
Thursday, April 19, 2012 4:05 PM -
Hello,
Please check out the link below. It will help you.
http://www.codeproject.com/Articles/19689/Working-with-Active-Directory-in-VB-NET
http://vijirajkumar.blogspot.com/2009/12/active-directory-using-vbnet.html
- Marked as answer by Lie You Thursday, April 26, 2012 3:11 AM
Friday, April 20, 2012 8:13 AM -
Hi Ian,
Please check, one sample code is given here:
http://www.codeproject.com/Articles/19689/Working-with-Active-Directory-in-VB-NET
And another very good post is here:
http://vijirajkumar.blogspot.in/2009/12/active-directory-using-vbnet.html
Regards, http://shwetamannjain.blogspot.com
- Proposed as answer by Shweta Jain (Lodha) Sunday, April 22, 2012 2:36 AM
- Marked as answer by Lie You Thursday, April 26, 2012 3:11 AM
Sunday, April 22, 2012 2:36 AM