I am completely new with LDAP and I need to retreive some informations in my office LDAP, nobody's here to help me. Here is the information I got (I change a little bit for security reasons) :
- host : the.ldap.host
- search base : ou=People,dc=xxx,dc=yyyy,dc=zzzzz
- filter : (projectTeams=manager)
- user : uid=eric, ou=Technical,dc=xxx,dc=yyyy,dc=zzzzz
- password : blabla
That's all I get to do the job to find all the "manager"
Here is my code :
Dim oRoot2 As DirectoryEntry = New DirectoryEntry ("LDAP://the.ldap.host", "uid=eric,ou=Technical,dc=xxx,dc=yyyy,dc=zzzzz", "blabla",AuthenticationTypes.None)
try
Dim connected As Object = oRoot2.NativeObject
msgbox "Connected"
Dim searcher As DirectorySearcher = New DirectorySearcher(oRoot2)
searcher.Filter = "(projectTeams=manager)"
Dim DirEntry As DirectoryEntry
For Each result As SearchResult In searcher.FindAll
DirEntry = result.GetDirectoryEntry
lst.Items.Add(DirEntry.Properties("iam-uid").Value)
Next
catch ex as exception
msgbox (ex.message)
End try
When running, I received the "Connected" messagebox but then I get an error "There is no such objet on the server". This error is thrown when performing the line bellow :
For Each result As SearchResult In searcher.FindAll
I do not know how to code that the search base is "ou=People,dc=xxx,dc=yyyy,dc=zzzzz"
I already spent two days trying. All help is welcome.