【发布时间】:2015-10-05 08:33:38
【问题描述】:
我使用绑定到 AD 根目录的 DirectorySearcher 运行以下 LDAP 查询:
(&(|(objectClass=container)(objectClass=organizationalUnit))(!(distinguishedName=OU=)(*&^%\\\#@$!\\\#$%^,OU=xyxy.yxyx,OU=yyyy,OU=tttt,DC=base,DC=local)))
但是,它不返回任何 OU。当我使用下面的其他 OU 运行相同的查询时,我会在 AD 中获得所有其他 OU:
(&(|(objectClass=container)(objectClass=organizationalUnit))(!(distinguishedName=OU=SOMEOU,OU=xyxy.yxyx,OU=yyyy,OU=tttt,DC=base,DC=local)))
基本上,我正在尝试对排除某些特定 OU 的所有 OU 运行查询。我猜这与 OU 名称中的特殊字符有关。
【问题讨论】:
-
您要排除的 OU 的名称是什么?
*&^%\\\#@$!\\\#$%^,OU=xyxy.yxyx,OU=yyyy,OU=tttt,DC=base,DC=local? -
我正在使用的 OU 的名称是:)(*&^%\#@$!\#$%^and that is under OU tttt which is under OU yyyy and the whole thing is under域 base.local。
标签: c# active-directory ldap