GetDiscoverySearchConfiguration 操作
查找有关 GetDiscoverySearchConfiguration EWS 操作的信息。
GetDiscoverySearchConfiguration 操作返回就地保留、保存的发现搜索以及启用发现搜索的邮箱的配置信息。
Exchange Server 2013 中引入了此操作。
使用 GetDiscoverySearchConfiguration 操作
GetDiscoverySearchConfiguration 操作为发现搜索提供配置信息。 请求可以包含以下一个或多个参数:
SearchId — 标识保存的发现搜索。 如果在请求中发送此参数,则忽略其他参数的值。
ExpandGroupMembership - 指示是否在响应中展开组成员身份。 值为 true 表示组成员身份已展开,以便在响应中返回所有可搜索邮箱。 值为 false 表示响应中仅返回组。
InPlaceHoldConfigurationOnly - 指示除就地保留配置外是否返回所有可搜索邮箱。 值为 true 表示仅返回就地保留配置。 值为 false 表示除就地保留标识符外,还会返回所有可搜索邮箱标识符。 如果不存在此元素,则默认行为等效于值 false。
GetDiscoverySearchConfiguration 操作 SOAP 标头
GetDiscoverySearchConfiguration 操作可以使用下表中列出的 SOAP 标头。
标头名称 | 元素 | 说明 |
---|---|---|
ManagementRole |
ManagementRole |
标识调用方发出请求所需的服务器角色。 此标头适用于请求。 |
RequestVersion |
RequestServerVersion |
标识操作请求的架构版本。 此标头适用于请求。 |
ServerVersion |
ServerVersionInfo |
标识响应请求的服务器版本。 此标头适用于响应。 |
GetDiscoverySearchConfiguration 操作请求示例:获取已保存搜索的发现搜索配置
下面的 GetDiscoverySearchConfiguration 操作请求示例演示如何请求名为“MyDiscSearchFor-sbrown”的已保存搜索的配置。 将忽略 ExpandGroupMembership 和 InPlaceHoldConfigurationOnly 元素的参数。
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013" />
</soap:Header>
<soap:Body >
<m:GetDiscoverySearchConfiguration>
<m:SearchId>MyDiscSearchFor-sbrown</m:SearchId>
<m:ExpandGroupMembership>true</m:ExpandGroupMembership>
<m:InPlaceHoldConfigurationOnly>false</m:InPlaceHoldConfigurationOnly>
</m:GetDiscoverySearchConfiguration>
</soap:Body>
</soap:Envelope>
请求 SOAP 正文包含以下元素:
GetDiscoverySearchConfiguration 操作响应成功:请求单个已保存的搜索
以下示例显示了对 GetDiscoverySearchConfiguration 操作请求的成功响应,请求获取名为“MyDiscSearchFor-sbrown”的已保存搜索的配置。
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="526" MinorBuildNumber="0" Version="Exchange2013" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDiscoverySearchConfigurationResponse ResponseClass="Success" xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ResponseCode>NoError</ResponseCode>
<DiscoverySearchConfigurations>
<DiscoverySearchConfiguration xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<SearchId>MyDiscSearchFor-sbrown</SearchId>
<SearchQuery>test item</SearchQuery>
<SearchableMailboxes>
<SearchableMailbox>
<Guid>3c620d04-8b22-432e-92be-5b9321599576</Guid>
<PrimarySmtpAddress>SBrown@contoso.com</PrimarySmtpAddress>
<IsExternalMailbox>false</IsExternalMailbox>
<ExternalEmailAddress/>
<DisplayName>Steven Brown</DisplayName>
<IsMembershipGroup>false</IsMembershipGroup>
<ReferenceId>/o=First/ou=Exchange(FYDILT)/cn=Recipients/cn=313ecf-Steve</ReferenceId>
</SearchableMailbox>
</SearchableMailboxes>
</DiscoverySearchConfiguration>
</DiscoverySearchConfigurations>
</GetDiscoverySearchConfigurationResponse>
</s:Body>
</s:Envelope>
响应 SOAP 正文包含以下元素:
GetDiscoverySearchConfiguration 操作响应成功:就地保留请求
以下示例演示了对 GetDiscoverySearchConfiguration 操作请求的成功响应,以仅获取就地保留。
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15"
MinorVersion="0"
MajorBuildNumber="526"
MinorBuildNumber="0"
Version="Exchange2013"
xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDiscoverySearchConfigurationResponse ResponseClass="Success"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ResponseCode>NoError</ResponseCode>
<DiscoverySearchConfigurations>
<DiscoverySearchConfiguration xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<SearchId>MyDiscSearchFor-sbrown</SearchId>
<SearchQuery>test item</SearchQuery>
<InPlaceHoldIdentity>3f37d90f53144558a80814ef0272749a9</InPlaceHoldIdentity>
<ManagedByOrganization/>
</DiscoverySearchConfiguration>
<DiscoverySearchConfiguration xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<SearchId>MyDiscSearch</SearchId>
<SearchQuery>test</SearchQuery>
<InPlaceHoldIdentity>6ea486f0f3f140efb044682a2e782abdf</InPlaceHoldIdentity>
<ManagedByOrganization/>
</DiscoverySearchConfiguration>
</DiscoverySearchConfigurations>
</GetDiscoverySearchConfigurationResponse>
</s:Body>
</s:Envelope>
响应 SOAP 正文包含以下元素:
GetDiscoverySearchConfiguration 操作成功响应:请求所有保存的发现搜索配置
以下示例显示了对 GetDiscoverySearchConfiguration 操作请求的成功响应,以获取所有保存的发现搜索。
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15"
MinorVersion="0"
MajorBuildNumber="526"
MinorBuildNumber="0"
Version="Exchange2013"
xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDiscoverySearchConfigurationResponse ResponseClass="Success"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<ResponseCode>NoError</ResponseCode>
<DiscoverySearchConfigurations>
<DiscoverySearchConfiguration xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<SearchId>MyDiscSearchFor-sbrown</SearchId>
<SearchQuery>test item</SearchQuery>
<SearchableMailboxes>
<SearchableMailbox>
<Guid>3c620d04-8b33-435e-95be-5b9351599576</Guid>
<PrimarySmtpAddress>SBrown@contoso.com</PrimarySmtpAddress>
<IsExternalMailbox>false</IsExternalMailbox>
<ExternalEmailAddress/>
<DisplayName>Steven Brown</DisplayName>
<IsMembershipGroup>false</IsMembershipGroup>
<ReferenceId>/o=First/ou=Exchange (FYLT)/cn=Recipients/cn=35381a742f0e47e395c8601a60d13ecz-Steve</ReferenceId>
</SearchableMailbox>
</SearchableMailboxes>
</DiscoverySearchConfiguration>
<DiscoverySearchConfiguration xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<SearchId>MyDiscSearch</SearchId>
<SearchQuery>test</SearchQuery>
<SearchableMailboxes>
<SearchableMailbox>
<Guid>e788c4b0-54a2-458c-83b2-22d5bb02b23f</Guid>
<PrimarySmtpAddress>Administrator@contoso.com</PrimarySmtpAddress>
<IsExternalMailbox>false</IsExternalMailbox>
<ExternalEmailAddress/>
<DisplayName>Administrator</DisplayName>
<IsMembershipGroup>false</IsMembershipGroup>
<ReferenceId>/o=First/ou=Exchange (FYLT)/cn=Recipients/cn=ebez7871332d4595abe1c62962911a58-Admin</ReferenceId>
</SearchableMailbox>
<SearchableMailbox>
<Guid>6f6cff39-8967-4a60-b43f-328413c25199</Guid>
<PrimarySmtpAddress>ADavis@contoso.com</PrimarySmtpAddress>
<IsExternalMailbox>false</IsExternalMailbox>
<ExternalEmailAddress/>
<DisplayName>Anthony Davis</DisplayName>
<IsMembershipGroup>false</IsMembershipGroup>
<ReferenceId>/o=First/ou=Exchange (FYLT)/cn=Recipients/cn=f10c9f70519844beb04101d8f40c572z-Antho</ReferenceId>
</SearchableMailbox>
</SearchableMailboxes>
</DiscoverySearchConfiguration>
</DiscoverySearchConfigurations>
</GetDiscoverySearchConfigurationResponse>
</s:Body>
</s:Envelope>
响应 SOAP 正文包含以下元素:
GetDiscoverySearchConfiguration 操作错误响应
以下示例显示了 对 GetDiscoverySearchConfiguration 操作请求的错误响应。 这是对获取服务器上未找到的已保存搜索的请求的响应。
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo MajorVersion="15"
MinorVersion="0"
MajorBuildNumber="526"
MinorBuildNumber="0"
Version="Exchange2013"
xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetDiscoverySearchConfigurationResponse ResponseClass="Error"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<MessageText>Search configuration corresponding to the search id was not found.</MessageText>
<ResponseCode>ErrorInvalidArgument</ResponseCode>
<DescriptiveLinkKey>0</DescriptiveLinkKey>
<DiscoverySearchConfigurations/>
</GetDiscoverySearchConfigurationResponse>
</s:Body>
</s:Envelope>
错误响应 SOAP 正文包含以下元素:
有关 EWS 通用且特定于此操作的其他错误代码,请参阅 ResponseCode。