LDAP_OPERATIONS_ERROR

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All,

My problem is, on calling ldap_search_ext_s(), I am getting a successful
resultset, but this function is throwing LDAP_OPERATIONS_ERROR.

Did anyone encountered this problem before and what could the possible
reason why the function throws an error but the resultset is successful?

Thanks in advance!
 
Hello Joe,

Here are the parameter values I am passing for ldap_search_ext_s function
LDAP *ld
SearchRoot='dc=stagingarea,dc=nms,dc=dtt'
SearchScope=LDAP_SCOPE_SUBTREE
SearchFilter='(&(objectclass=user)(&(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*)))
SearchAttributes='cn'
attrsonly = 0
ServerControls = NULL
ClientControls = NULL
TimeOut = 0
Results limit = 1000
LDAPMessage **res
 
From an AD standpoint I see nothing really wrong there. The query isn't
as efficient as it should be and lists objectclass=user twice for no
apparent reason.

I would change the query to

(&(objectcategory=person)(&(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*)))

But again, Windows wouldn't throw an ops error there.

If you would, run the query from adfind, it would look like (all one line)

adfind -b dc=stagingarea,dc=nms,dc=dtt -f
"(&(objectcategory=person)(&(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*)))"
cn -exterr


My expectation is that whatever you are using to do the query may not be
authenticated and doing it with Adfind will work fine as it uses the
current creds. However if it doesn't work, we may get a better error
message.


--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm
 
Back
Top