vb.net - LDAP departmentnumber query -



vb.net - LDAP departmentnumber query -

i attempting query list of users assigned specific departmentnumber in ldap, know should list of 100. below code pulls 1 fellow member (which lastly name starts t, in mind seems it's returning lastly value):

dim userids ienumerable(of string) = {"7871"} each string in userids dim de new directoryentry("ldap://test.net:389/dc=test,dc=net") dim ldapfilter string = "(departmentnumber=" & & ")" dim searcher new directorysearcher(de, ldapfilter) dim result searchresult = searcher.findone() dim res searchresultcollection = searcher.findall() dim item listviewitem = listview1.items.add(i) item.subitems.add(result.properties("givenname")(0).tostring()) item.subitems.add(result.properties("cn")(0).tostring()) item.subitems.add(result.properties("userprincipalname")(0).tostring()) next

this works:

dim userids ienumerable(of string) = {"7871"} each string in userids dim de new directoryentry("ldap://test.net:389/dc=test,dc=net") dim ldapfilter string = "(departmentnumber=" & & ")" dim searcher new directorysearcher(de, ldapfilter) dim result searchresult dim res searchresultcollection = searcher.findall() each result in res dim item listviewitem = listview1.items.add(i) item.subitems.add(result.properties("givenname")(0).tostring()) item.subitems.add(result.properties("cn")(0).tostring()) item.subitems.add(result.properties("userprincipalname")(0).tostring()) next next

vb.net ldap

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -