Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBMS_LDAP.SEARCH_S filter to remove disabled accounts

DunbarOct 17 2016 — edited Nov 2 2016

Due to a lack material online I am currently unable to fix an issue when querying LDAP with DBMS_LDAP.SEARCH_S.

Our company has multiple LDAP's and two of which have over 20,000 users. I want to make a call that ignores all disabled users so I attempted this:

vretval := DBMS_LDAP.SEARCH_S(vsession, vldap_base, DBMS_LDAP.SCOPE_SUBTREE,

'(&(objectClass=person)(!(UserAccountControl:1.2.840.113556.1.4.803:=2))(sAMAccountName='||vletter||'*))',

vattrs,

0,

vmessage);

Please note I do not receive any errors just 0 entries from the above call.

If I run this:

vretval := DBMS_LDAP.SEARCH_S(vsession, vldap_base,

DBMS_LDAP.SCOPE_SUBTREE,

'(&(objectClass=person)(sAMAccountName='||vletter||'*))',

vattrs,

0,

vmessage);

I will receive all entries in the LDAP that start with the letter in vletter.

Does anyone know why I DBMS_LDAP.SEARCH_S would return 0 entries but if removed returns all?

As there is very little material and info on OTN in regards to usage of DBMS_LDAP.SEARCH_S I am unable to reduce my search to a group that something that won't get a timeout error.

This post has been answered by Dunbar on Nov 2 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2016
Added on Oct 17 2016
1 comment
855 views