我的目标是使用GivenName / Surname过滤器在GAL和用户的本地联系人中进行搜索,然后将汇总的搜索结果与一些联系人详细信息(联系电话号码等)一起返回给用户 .

Exchange 2013和Exchange 2016都需要支持它 .

根据微软的文档,FindPeople似乎从2013年开始支持GAL和用户的本地联系人 . 因此,对两个目录的请求都是使用相同的EWS API实现的 - FindPeople / GetPersona .

但我遇到了以下问题 .

在Exchange 2016上使用“FindPeople”EWS查询时,搜索可以正常用于GAL和个人目录 .

但是在Exchange 2013上使用“FindPeople”时:

  • 搜索适用于GAL;

  • 但个人目录失败 - 服务器返回200 OK,结果列表为空:

<FindPeopleResponse ResponseClass="Success" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages>
    <ResponseCode>NoError</ResponseCode>
    <People/>
    <TotalNumberOfPeopleInView>0</TotalNumberOfPeopleInView
    <FirstMatchingRowIndex>0</FirstMatchingRowIndex
    <FirstLoadedRowIndex>0</FirstLoadedRowIndex>
</FindPeopleResponse>

虽然个人目录中的项目与搜索过滤器匹配 .

问题:

1)所有Exchange 2013版本是否支持个人目录搜索?或者可能需要在较旧的Exchange 2013版本上安装某些补丁或服务包?

2)是否应在Exchange Server 2013上进行某些配置以允许使用EWS API在个人目录中进行搜索?

3)如果不需要为支持做任何特殊处理,并且一切都应该适用于任何Exchange 2013,那么有什么方法可以解决这个问题吗?

尝试检查EWS日志根据:

https://ingogegenwarth.wordpress.com/2017/01/12/troubleshooting-exchange-with-logparser-ews-logs/

但似乎没有太多额外的信息 - 只有服务器返回200 OK .

更新:

FindPeople使用的确切查询是:

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
               xmlns:m=\"http://schemas.microsoft.com/exchange/services/2006/messages\"
               xmlns:t=\"http://schemas.microsoft.com/exchange/services/2006/types\"
               xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
<soap:Header>
    <t:RequestServerVersion Version="Exchange2013" />
</soap:Header>
<soap:Body>
    <m:FindPeople>
        <m:PersonaShape>
            <t:BaseShape>IdOnly</t:BaseShape>
            <t:AdditionalProperties>
                <t:FieldURI FieldURI="persona:DisplayName"/>
                <t:FieldURI FieldURI="persona:Surname"/>
                <t:FieldURI FieldURI="persona:GivenName"/>
            </t:AdditionalProperties>
        </m:PersonaShape>
        <m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="100" Offset="0"/>
        <m:ParentFolderId>
            <t:DistinguishedFolderId Id="contacts"/>
        </m:ParentFolderId>
        <m:QueryString>meo</m:QueryString>
    </m:FindPeople>
</soap:Body>
</soap:Envelope>

提前致谢