Posted on 2006-03-28
Last Modified: 2012-08-14
How can I use IADS to access and manipulate active directory in visual studio using, this was so easy using visual studio 6.0....

Question by:remorknevets
    LVL 4

    Expert Comment

    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.

    Author Comment

    How can I enumerate all users using directory services in  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...
    LVL 4

    Accepted Solution

    Active Directory Object Browser written in with full source code
    LVL 4

    Expert Comment

    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 & "%" &
    End If
    Next 'ObjUser
    objContainer = GetObject(ldapquerystring)
    Next 'Itercount

    Author Comment

    kmichie, what references  need to be imported in Visual Studio .net for your code to work?
    LVL 4

    Expert Comment

    System.DirectoryServices should be all you need

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
    A short article about problems I had with the new location API and permissions in Marshmallow
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now