php AD ldap 搜索过滤器特定的 OUS

问题描述

这是我的广告结构 AD structure,running ldap query with php

ldap_set_option($ds,LDAP_OPT_PROTOCOL_VERSION,3);
ldap_set_option($ds,LDAP_OPT_REFERRALS,0);

$term = $_GET["term"];

$rAD = ldap_bind($ds,$admin,$passwd);
$andThis="(&(cn=*$term*)(objectClass=User))";

$results1ADl = ldap_search($ds,$dn,$andThis);

$info = ldap_get_entries($ds,$results1ADl);


for ($i = 0; $i < $info["count"]; $i++) {

    $fullname[$i] = $info[$i]['cn'][0];
}

需要排除“搜索”下的所有 OU,但突出显示的 OU 除外,标记为 1 和 2。 这样做的最佳方法是什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)