AddDistributionGroupToImList 操作AddDistributionGroupToImList operation

查找有关AddDistributionGroupToImList EWS 操作的信息。Find information about the AddDistributionGroupToImList EWS operation.

AddDistributionGroupToImList Exchange Web 服务(EWS)操作将通讯组添加到统一联系人存储库中的即时消息(IM)列表中。The AddDistributionGroupToImList Exchange Web Services (EWS) operation adds a distribution group to the instant messaging (IM) list in the Unified Contact Store.

Exchange Server 2013 中引入了此操作。This operation was introduced in Exchange Server 2013.

使用 AddDistributionGroupToImList 操作Using the AddDistributionGroupToImList operation

AddDistributionGroupToImList操作采用单个参数来标识要添加到 IM 列表中的通讯组。The AddDistributionGroupToImList operation takes a single argument that identifies a distribution group to add to the IM list. 此操作不会创建通讯组;必须已创建通讯组。This operation does not create a distribution group; the distribution group must already be created.

此操作可以使用下表中列出的 SOAP 标头。This operation can use the SOAP headers that are listed in the following table.

表1。AddDistributionGroupToImList 操作 SOAP 标头Table 1. AddDistributionGroupToImList operation SOAP headers

标头名称Header name 元素Element 说明Description
模拟Impersonation
ExchangeImpersonationExchangeImpersonation
标识客户端应用程序模拟的用户。Identifies the user whom the client application is impersonating. 这适用于请求。This is applicable to a request.
MailboxCultureMailboxCulture
MailboxCultureMailboxCulture
确定用于访问邮箱的区域性(如 RFC 3066 中定义的用于标识语言的标记)。Identifies the culture, as defined in RFC 3066, "Tags for the Identification of Languages", to be used to access the mailbox. 这适用于请求。This is applicable to a request.
RequestVersionRequestVersion
RequestServerVersionRequestServerVersion
标识操作请求的架构版本。Identifies the schema version for the operation request. 这适用于请求。This is applicable to a request.
ServerVersionServerVersion
ServerVersionInfoServerVersionInfo
标识响应请求的服务器版本。Identifies the version of the server that responded to the request. 这适用于响应。This is applicable to a response.

AddDistributionGroupToImList 操作请求示例AddDistributionGroupToImList operation request example

以下示例的AddDistributionGroupToImList操作请求显示如何将通讯组添加到 IM 列表。The following example of an AddDistributionGroupToImList operation request shows how to add a distribution group to the IM list.

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
               xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages">
   <soap:Header>
      <t:RequestServerVersion Version="Exchange2013" />
      <t:MailboxCulture>en-US</t:MailboxCulture>
   </soap:Header>
   <soap:Body >
      <m:AddDistributionGroupToImList>
         <m:SmtpAddress>distributionlist1@example.com</m:SmtpAddress>
      </m:AddDistributionGroupToImList>
   </soap:Body>
</soap:Envelope>

请求 SOAP 正文包含以下元素:The request SOAP body contains the following elements:

成功的 AddDistributionGroupToImList 操作响应Successful AddDistributionGroupToImList operation response

下面的示例演示对AddDistributionGroupToImList操作请求的成功响应。The following example shows a successful response to an AddDistributionGroupToImList operation request.

成功的响应包含通讯组显示名称、通讯组的 Exchange 存储类以及新通讯组的 EWS 标识符。The successful response contains the distribution group display name, the Exchange store class for the distribution group, and the EWS identifier of the new distribution group.

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
            xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages">
   <s:Header>
      <t:ServerVersionInfo MajorVersion="15" 
                           MinorVersion="0" 
                           MajorBuildNumber="349" 
                           MinorBuildNumber="0" 
                           Version="Exchange2013"/>
   </s:Header>
   <s:Body>
      <m:AddDistributionGroupToImListResponse ResponseClass="Success">
         <m:ResponseCode>NoError</m:ResponseCode>
         <m:ImGroup>
            <t:DisplayName>distributionlist1@example.com</t:DisplayName>
            <t:GroupType>IPM.DistList.MOC.DG</t:GroupType>
            <t:ExchangeStoreId Id="AAMkAGQ1MjJjAA=" 
                             ChangeKey="EgAAAA=="/>
      </m:ImGroup>
      </m:AddDistributionGroupToImListResponse>
   </s:Body>
</s:Envelope>

响应 SOAP 正文包含以下元素:The response SOAP body contains the following elements:

AddDistributionGroupToImList 操作 ErrorInvalidImDistributionGroupSmtpAddress 错误响应AddDistributionGroupToImList operation ErrorInvalidImDistributionGroupSmtpAddress error response

下面的示例演示对AddDistributionGroupToImList操作请求的错误响应。The following example shows an error response to an AddDistributionGroupToImList operation request. 当尝试添加 Exchange 存储中不存在的通讯组时,将发生以下错误响应。The following error response occurs when an attempt is made to add a distribution group that does not exist in the Exchange store.

<?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="349" 
                           MinorBuildNumber="0" 
                           Version="Exchange2013" 
                           xmlns:h="https://schemas.microsoft.com/exchange/services/2006/types" 
                           xmlns="https://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">
      <AddDistributionGroupToImListResponse ResponseClass="Error" 
                                            xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
         <MessageText>The specified IM distribution group SMTP address is invalid.</MessageText>
         <ResponseCode>ErrorInvalidImDistributionGroupSmtpAddress</ResponseCode>
         <DescriptiveLinkKey>0</DescriptiveLinkKey>
      </AddDistributionGroupToImListResponse>
   </s:Body>
</s:Envelope>

错误响应 SOAP 正文包含以下元素:The error response SOAP body contains the following elements:

另请参阅See also