Results 1 to 2 of 2

Thread: How to get All user names from active directory?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2006
    Posts
    14

    How to get All user names from active directory?

    Hi,

    Please any one can help me out to solve this problem?????

    now i writing application in vb 6.it sholud get all user name form active directory. i am using below code but its not woking.

    please help me ..


    thanks for your help..
    Code:
    Sub InitializeVariables()
    Dim cLDAPServer, cLDAPPort, cOrganization
    
    cLDAPPort = "1005"
    cLDAPServer = "LocalHost"
    cOrganization = "CustSelfServ"
    g_szPrefix = "LDAP://" & cLDAPServer & ":" & cLDAPPort & "/o=" & cOrganization 
    
    End Sub
    
    Sub ProcessForAttributes()
    
    Dim objSchemaContainer, objMember
    'On Error Resume Next
    
    Set objSchemaContainer = GetObject(g_szPrefix + "/ou=Members")
    if Err.Number 0 then
    MsgBox "Error"
    Exit Sub
    End If
    
    MsgBox "Testing for members"
    For each Child in objSchemaContainer
    MsgBox "Child Name = " & Child.Name
    Set objMember = GetObject(g_szPrefix + "/ou=Members/" + Child.Name)
    ' MsgBox "County= " + objMember.county
    if Err.Number 0 then
    MsgBox "Error"
    Exit Sub
    End If
    Next

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to get All user names from active directory?

    Moved From The FAQ Section

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width