Search code examples
exchange-serverexchangewebservicesews-managed-api

Get Delegates EWS API returning empty response


I have been using EWS managed APIs to get exchange admin related information. The getDelegates call always returns an empty response even though I have delegates configured and I actually see the event in the audit log for exchange. The other API calls like getting inbox rules etc works just fine using the same approach.

Is there anything else I need to do for getting the delegate users to a mailbox via EWS or is this just not supported?

Here is the request xml:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Header>
      <t:RequestServerVersion Version="Exchange2013" />
      <t:ExchangeImpersonation>
         <t:ConnectingSID>
            <t:PrincipalName>u2@xyz.com</t:PrincipalName>
         </t:ConnectingSID>
      </t:ExchangeImpersonation>
   </soap:Header>
   <soap:Body>
      <m:GetDelegate IncludePermissions="true">
         <m:Mailbox>
            <t:EmailAddress>u2@xyz.com</t:EmailAddress>
         </m:Mailbox>
      </m:GetDelegate>
   </soap:Body>
</soap:Envelope>

Here is the response

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="1084" MinorBuildNumber="30" Version="V2017_04_14" xmlns:h="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>
    <m:GetDelegateResponse ResponseClass="Success" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
      <m:ResponseCode>NoError</m:ResponseCode>
      <m:DeliverMeetingRequests>DelegatesOnly</m:DeliverMeetingRequests>
    </m:GetDelegateResponse>
  </s:Body>
</s:Envelope>

Solution

  • Was able to resolve this issue. Seems like there is a change in the way the delegate sharing was modeled. The legacy way of assigning delegate permissions with full access via the EAC or the office portal no longer works. It will not show up as delegates. This was confirmed by the MS support engineer.

    The only way I got delegates to work is by added users with permissions to specific folders in a user's mailbox. More information can be found here:

    https://support.microsoft.com/en-us/help/2572646/how-to-grant-exchange-and-outlook-mailbox-permissions-in-office-365-dedicated

    Configuring via the outlook client: https://blogs.office.com/2013/09/04/configuring-delegate-access-in-outlook-web-app/