I need to get the 'employeenumber' of all the employees whose 'epersonstatus=REMOVE' using an Ldap search implemented using .NET/C# like:
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" });
Since there are thousands of entries I am using paged requests as proposed here: http://dunnry.com/blog/PagingInSystemDirectoryServicesProtocols.aspx
I have also checked that the server supports paged requests as proposed here: iPlanet LDAP and C# PageResultRequestControl
Once the flow reaches:
SearchResponse response = connection.SendRequest(request) as SearchResponse;
I get a DirectoryOperationException with message "The requested attribute does not exist".
By running the same query on a LDap client like softerra I get the entries (a thousand) and the error.
Some help would be greatly appreciated.