1

我有一个带有我的电子邮件联系人的 LDAP 服务器,这样我就可以按姓名/电子邮件等查找联系人。但是,它似乎只搜索并找到任何联系人的第一个电子邮件地址。

例如,如果我有一个人:

LastName: Doe
FirstName: John
Email: jdoe@work.com
Email2: johndoe@home.com
Email3: johndoe@fun.com

它只搜索或返回第一封电子邮件。例如,如果我搜索“John”,它只会返回“jdoe@work.com”,即使其他两个电子邮件地址中包含“john”。我尝试过的搜索过滤器是:

//This one will both look through and match the first email but ignores the 2nd/3rd
(|(displayName=*%v*)(mail=*%v*)(uid=*%v*)(givenname=*%v*)(sn=*%v*)(cn=*%v*))

//This one throws an error saying "mail2" and "mail3" are invalid filters.
(|(displayName=*%v*)(mail=*%v*)(mail2=*%v*)(mail3=*%v*)(uid=*%v*)(givenname=*%v*)(sn=*%v*)(cn=*%v*))

我应该使用什么?

另外,是否有人有指向某个页面的链接,其中列出了我可以在 ldap 人员搜索中放入的所有可能的过滤器?

4

3 回答 3

1

Exchange does not store additional mailaddresses in fields like mail2 or mail3. All addresses are stored in the multi-valued field "proxyAddresses". This field contains one line for each address in the form of

address-type:address

Example:

smtp:test@contoso.local SMTP:user@contoso.local

The second entry in the example would be main address for that account, because the SMTP prefix is all uppercase.

So you would search for (proxyAddress=%v) or something like that. I don't know the LDAP search syntax out of my head.

Edit: Another option is to use the ResolveNames operation of the EWS webservices (see http://www.infinitec.de/post/2009/04/13/Resolving-the-primary-email-address-with-Exchange-WebServices-ResolveNames-operation.aspx and http://msdn.microsoft.com/en-us/library/aa563518(v=exchg.140).aspx).

于 2011-08-09T21:05:29.593 回答
1

过滤器:

(|(displayName=*%v*)(mail=*%v*)(uid=*%v*)(givenname=*%v*)(sn=*%v*)(cn=*%v*))

将不匹配条目:

LastName: Doe
FirstName: John
Email: jdoe@work.com
Email2: johndoe@home.com
Email3: johndoe@fun.com

因为没有过滤器断言与给定条目中的任何属性名称匹配。

(|(Email=jd*)(Email2=john*)(Email3=john*)(lastName=Do*))

会匹配。您是否考虑过为您提供的示例条目使用标准名称?

于 2011-08-10T09:37:27.150 回答
1

Active Directory 发布时带有一些值得怀疑的架构选择。现在很难修复它们。

其中之一是邮件,被标记为单值。这应该是一个多值属性。因此使用 proxyAddresses,它尝试通过使用 smtp: 或 x500: 或 SIP: 来为该地址指定协议来重载具有更多信息的字符串语法属性。然后大写(SMTP)表示主要,小写(smtp)表示次要。

这也发生在 phoneNumber 为单值时,额外的值现在溢出到属性 otherPhone 中。

同样适用于:

  • 传真电话号码和其他传真电话号码
  • labelledUri 和 url
  • homePhone 和其他HomePhone
  • 寻呼机和其他寻呼机
  • 移动和其他移动
于 2017-03-29T17:48:56.563 回答