我正在使用 ldap 函数来使用 win32 api 获取用户属性值。
用户名是arun
。
在像 init、set_options、connect、bind 这样的 ldap_functions 中是成功的。但是 ldap 搜索函数返回错误代码 10。
这是我的代码
errorCode = ldap_search_s(
pLdapConnection, // Session handle
pMyDN, // DN to start search
LDAP_SCOPE_SUBTREE, // Scope LDAP_SCOPE_BASE LDAP_SCOPE_SUBTREE
pMyFilter, // Filter
NULL, // Retrieve list of attributes
0, // Get both attributes and values
&pSearchResult);
在pMyDN
指定的`"DC=SANJU,DC=CO,DC=IN"...
返回代码 10 给出的错误是LDAP_REFERRAL
。但我无法得到它。
但我把pMyDN
价值投入"OU=Marketing,DC=SANJU,DC=CO,DC=IN"
现在,搜索功能成功了,那么问题出在哪里?
我需要这个功能而不使用OU,有人可以帮忙吗?