4.1 Setting Holds On Mailboxes

This example of the SetHoldOnMailboxes operation, as defined in section 3.1.4.5, shows how the client requests the server to set holds on mailboxes. In this example, the client requests holds on two mailboxes and assigns the hold ID "HoldId2".

 <?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:SetHoldOnMailboxes>
       <m:ActionType>Create</m:ActionType>
       <m:HoldId>HoldId2</m:HoldId>
       <m:Query>test</m:Query>
       <m:Mailboxes>
         <t:String>/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=1fa841ff5e4749ba93ecc0fd98c2cadf-Willi</t:String>
          <t:String>/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=aed2146adaa24ffc9f0f279917e8de95-Micha</t:String>
       </m:Mailboxes>
       <m:Language>English</m:Language>
       <m:IncludeNonIndexableItems>false</m:IncludeNonIndexableItems>
       <m:Deduplication>true</m:Deduplication>
     </m:SetHoldOnMailboxes>
   </soap:Body>
 </soap:Envelope>

The server returns the following successful response to the client.

 <?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">
     <SetHoldOnMailboxesResponse ResponseClass="Success" 
           xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
       <ResponseCode>NoError</ResponseCode>
       <MailboxHoldResult>
         <HoldId xmlns="http://schemas.microsoft.com/exchange/services/2006/types">HoldId2</HoldId>
         <Query xmlns="http://schemas.microsoft.com/exchange/services/2006/types">test</Query>
         <MailboxHoldStatuses xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
           <MailboxHoldStatus>
             <Mailbox>/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=1fa841ff5e4749ba93ecc0fd98c2cadf-Willi</Mailbox>
             <Status>Pending</Status>
             <AdditionalInfo/>
           </MailboxHoldStatus>
           <MailboxHoldStatus>
             <Mailbox>/o=First Organization/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=aed2146adaa24ffc9f0f279917e8de95-Micha</Mailbox>
             <Status>Pending</Status>
             <AdditionalInfo/>
           </MailboxHoldStatus>
         </MailboxHoldStatuses>
       </MailboxHoldResult>
     </SetHoldOnMailboxesResponse>
   </s:Body>
 </s:Envelope>