分页LDap搜索失败,并显示“请求的属性不存在”

我需要使用使用.NET / C#实现的Ldap搜索来获得所有“epersonstatus = REMOVE”员工的’employeenumber’:

var connection = new LdapConnection("foo.bar.com:389"); connection.AuthType = AuthType.Anonymous; connection.SessionOptions.ProtocolVersion = 3; connection.Bind(); var request = new SearchRequest( "dc=root,dc=com", "(epersonstatus=REMOVE)", SearchScope.Subtree, new string[] { "employeenumber" }); 

由于我有数以千计的条目,我使用此处提出的分页请求: http : //dunnry.com/blog/PagingInSystemDirectoryServicesProtocols.aspx

我还检查了服务器是否支持此处提出的分页请求: iPlanet LDAP和C#PageResultRequestControl

一旦流量到达:

 SearchResponse response = connection.SendRequest(request) as SearchResponse; 

我得到一个DirectoryOperationException,消息“请求的属性不存在”。

通过在像softerra这样的LDap客户端上运行相同的查询,我得到条目(一千)和错误。

一些帮助将不胜感激。

我有一个类似的问题。

使用分页搜索时,我得到了exception"The server does not support the control. The control is critical." ,当使用非分页搜索时,我收到了结果(至少只要filter限制了最大数量)。

但是我发现错误信息是误导性的 – 问题隐藏在身份validation中。

使用AuthType.Basic (或AuthType.Anonymous )我收到错误。 我一切换到AuthType.Ntlm就可以了。

希望这可以帮助…