2015-07-13 78 views
0

我在查找允許從對象中提取信息的查詢,但也可以從此對象的層次結構中獲取信息。 例如,LDAP在對象層次結構中搜索屬性

1)用戶名DN是[email protected]
DN:[email protected],ou=Org1,ou=Org2,o=Org

屬性是
[email protected]
sn=name
givenname=user name [email protected]

2)ORG1 DN被
DN: ou=Org1,ou=Org2,o=Org

屬性ORG1是
ou=Org1
AreaCode=London
DistCode=125

3)ORG2 DN是
DN:ou=Org2,o=Org

屬性ORG2是
ou=Org2
CountryCode=GB
DealCode=2

當我設置上[email protected]過濾器,我怎麼能得到ou=Org1ou=Org2與一個(或多個)查詢DealCode屬性值的DistCode價值?

謝謝。

回答

0

如果「ou」和「cn」屬性的值在層次結構的不同級別上是唯一的(例如「cn = user.name @ location,ou = Org1,ou = Org2,o = Org」包含「ou」屬性!),您可以使用過濾器「(ou = Org2)(ou)在基礎」ou = Org2,o = org「(甚至」o = org「)上執行子樹搜索= Org1)(cn = user @ location)),並且將返回3個對象

+0

謝謝你Vilmantas。 – user3641406

+0

它部分地出現了,事實上,查詢提供了信息,但它不是一個結果提供的,我的意思是分別爲OU提供結果和爲CN提供信息,但查詢的目的是在一個數據集中提供OU結果和CN結果。 – user3641406