title: EWS are not currently available for this request because none of the Client Access Servers in the destination site could process the reques
body: <p>At first I received this error, when trying to delete all appointments on calendar on a specific person: "Exceeded maximum count of 1000 items that can be deleted in a single request"</p>
  
  <p>Then i tried fixing that by using batches of max size 1000 using this code:</p>
  
  <pre><code>    private IEnumerable&lt;IEnumerable&lt;T&gt;&gt; Batch&lt;T&gt;(IEnumerable&lt;T&gt; input, int batchSize)
  {
      List&lt;T&gt; items = new List&lt;T&gt;();
      foreach (var item in input)
      {
          items.Add(item);
          if (items.Count == batchSize)
          {
              yield return items;
              items = new List&lt;T&gt;();
          }
      }
      if (items.Count &gt; 0)
      {
          yield return items;
      }
  }
  </code></pre>
  
  <p>and then using this:</p>
  
  <pre><code>    var batches = Batch(GetAllSafeAppointments(calendar).Select(a =&gt; a.Id), 1000);
  foreach (var batch in batches)
  {
      service.DeleteItems(batch, DeleteMode.HardDelete, SendCancellationsMode.SendToNone, null);
  }
  </code></pre>
  
  <p>Then i receive this error: </p>
  
  <blockquote>
    <p>Exchange Web Services are not currently available for this request because none of the Client Access Servers in the destination site could process the request. ved Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ProcessWebException(WebException webException) ved Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request) ved Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest&amp; request) ved Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest1.Execute()
       ved Microsoft.Exchange.WebServices.Data.ExchangeService.InternalDeleteItems(IEnumerable1 itemIds, DeleteMode deleteMode, Nullable1 sendCancellationsMode, Nullable1 affectedTaskOccurrences, ServiceErrorHandling errorHandling, Boolean suppressReadReceipts) ved Microsoft.Exchange.WebServices.Data.ExchangeService.DeleteItems(IEnumerable1 itemIds, DeleteMode deleteMode, Nullable1 sendCancellationsMode, Nullable`1 affectedTaskOccurrences) ved SafeToExchangeSync.SafeScheduleSyncronizer.DeleteAllSafeAppointments(SCDriftConnection conn, ExchangeService service, SAFEAgent agent) i S:\s0book\xxx\xxx\xxx\SafeToExchangeSync\SafeScheduleSyncronizer.cs:linje 151</p>
  </blockquote>