?
Solved

IADS in vb.net

Posted on 2006-03-28
6
Medium Priority
?
1,468 Views
Last Modified: 2012-08-14
How can I use IADS to access and manipulate active directory in visual studio using vb.net, this was so easy using visual studio 6.0....

Thanks!
0
Comment
Question by:remorknevets
  • 4
  • 2
6 Comments
 
LVL 4

Expert Comment

by:kamichie
ID: 16311480
VB.NET has integrated Active Directory Handling, meaning you just need to put in a few imports, and use the appropriate objects. I'm posting a link to a simple tutorial that should help out.

http://www.vbdotnetheaven.com/Sections/ActiveDirectory.asp
0
 

Author Comment

by:remorknevets
ID: 16315457
How can I enumerate all users using directory services in vb.net?  I know how to use the LDAP path to display and update attributes for a specific user, but how can I move through the users in LDAP?  ie, a next button...
0
 
LVL 4

Accepted Solution

by:
kamichie earned 375 total points
ID: 16315614
Active Directory Object Browser written in vb.net with full source code

http://www.codeproject.com/dotnet/ActiveDONavigator.asp?df=100&forumid=175468&exp=0&select=1191150
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:kamichie
ID: 16315672
Should look something like this though

ldapquerystring = "LDAP://" & DistName

ds.SearchRoot = New DirectoryEntry(ldapquerystring)
ds.PageSize = 1000

Dim dsResult As DirectoryServices.SearchResult

i1 = ds.FindAll.Count
iterations = i1 / 1000

For iterCount = 1 To iterations
objContainer = GetObject(ldapquerystring)
For Each objUser In objContainer
i1 = 0 'reset the test value
strName = objUser.Name
i1 = strName.Length
If i1 > 0 Then
strDesc = objUser.Description
userFN = objUser.Get("givenName")
userSN = objUser.Get("sn")
userDesc = objUser.Get("description")
userCAI = objUser.Get("cvx-cai")
userBillCAI = objUser.Get("cvx-BillingCAI")
userDispN = objUser.Get("displayName")
outline = strName & "%" & userFN & "%" & userSN & "%" &
userDesc & "%" & userCAI & "%" & userBillCAI & "%" & userDispN & "%" &
DistName
WriteIt(outline)
End If
Next 'ObjUser
objContainer = GetObject(ldapquerystring)
Next 'Itercount
0
 

Author Comment

by:remorknevets
ID: 16321422
kmichie, what references  need to be imported in Visual Studio .net for your code to work?
0
 
LVL 4

Expert Comment

by:kamichie
ID: 16323002
System.DirectoryServices should be all you need
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Loops Section Overview

839 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