无法从LDAP服务器检索所有用户 [英] Not able to retrieve all users from LDAP server
问题描述
我要求在LDAP服务器中显示所有用户。 LDAP中有3000多个用户。当通过下面的条件尝试获取数据时,应用程序挂起
I am having a requirement of displaying all users in LDAP server. There are 3000+ users available in LDAP. When trying to fetch the data by putting condition like below, the application got hang
DirectorySearcher searcher = new DirectorySearcher(oDE);
DirectorySearcher searcher = new DirectorySearcher(oDE);
searcher.Filter ="(&(objectClass = simpleSecurityObject)(uid = *))" ;; //这将检索所有用户
searcher.Filter = "(&(objectClass=simpleSecurityObject)(uid=*))"; //this retrieve all users
但是相同的代码适用于LDAP环境中的开发环境有600位用户。
However the same code works for dev environment in which LDAP has 600 users.
请指导我解决此问题的更好方法。
Please guide me the better way to resolve this issue.
谢谢
推荐答案
使用
分页以读取页面中的数据。否则,您正在等待它加载所有数据。分页将允许您在进行时读取/更新UI。请注意,分页仍需要一段时间,您只需让用户知道
正在发生的事情。
Use paging to read your data in pages. Otherwise you're waiting for it to load all the data. Paging will allow you to read/update your UI as you go along. Note that paging is still going to take a while, you'll just be able to let the user know something is going on.
还应该提及您的过滤器看起来不适合用户。它似乎正在搜索所有内容,而不仅仅是用户。通常你必须指定
objectClass as`user`。
Should also mention that your filter doesn't look right for a user. It seems like it is searching everything, not just users. Generally you have to specify the objectClass as `user`.
最后请注意,服务器也将使用SizeLimit,所以如果你说的是3000多个用户,那么它就不会起作用了。我不确定分页是否会解决这个问题。
Finally note that the server is also going to use SizeLimit so if you're talking about 3000+ users then it isn't going to work. I'm not sure if paging will work around that.
这篇关于无法从LDAP服务器检索所有用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!