Available UserConfigurationName names for GetUserConfiguration for DistinguishedFolderId 'calendar'?

天涯浪子 提交于 2019-12-06 02:19:23

You'll need to perform a FindItem call with the Associated traversal option (available in 2010+). This will find all of the user configuration object (aka folder associated items) associated with the default calendar folder. You want to request the ItemClass since I believe it contains the configuration name used by EWS to access user configuration object. Depending on what created the user configuration object, you may need to parse out the user configuration name from the ItemClass.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               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" />
    <t:MailboxCulture>en-US</t:MailboxCulture>
  </soap:Header>
  <soap:Body>
    <m:FindItem Traversal="Associated">
      <m:ItemShape>
        <t:BaseShape>IdOnly</t:BaseShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="item:ItemClass"/>
        </t:AdditionalProperties>
      </m:ItemShape>
      <m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="100" Offset="0"/>
      <m:ParentFolderIds>
        <t:DistinguishedFolderId Id="calendar"/>
      </m:ParentFolderIds>
    </m:FindItem>
  </soap:Body>
</soap:Envelope>

You can see the relationship between the user configuration objects you know about (i.e. CategoryList, WorkHours, etc) and the ItemClass in the following response:

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo MajorVersion="15" />
  </s:Header>
  <s:Body>
    <m:FindItemResponse>
      <m:ResponseMessages>
        <m:FindItemResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:RootFolder IndexedPagingOffset="9" TotalItemsInView="9" IncludesLastItemInRange="true">
            <t:Items>
              <t:Message>
                <t:ItemId Id="AEz=" ChangeKey="CQ"/>
                <t:ItemClass>IPM.Configuration.HomeTimeZone</t:ItemClass>
              </t:Message>
              <t:Message>
                <t:ItemId Id="Az=" ChangeKey="CQ"/>
                <t:ItemClass>IPM.Configuration.AvailabilityOptions</t:ItemClass>
              </t:Message>
              <t:Message>
                <t:ItemId Id="AMz=" ChangeKey="CQ"/>
                <t:ItemClass>IPC.MS.Outlook.AgingProperties</t:ItemClass>
              </t:Message>
              <t:CalendarItem>
                <t:ItemId Id="ADEz=" ChangeKey="CQ"/>
                <t:ItemClass>IPM.Appointment</t:ItemClass>
              </t:CalendarItem>
              <t:Message>
                <t:ItemId Id="ADEz=" ChangeKey="CQ"/>
                <t:ItemClass>IPM.Configuration.CategoryList</t:ItemClass>
              </t:Message>
              <t:Message>
                <t:ItemId Id="ADEz=" ChangeKey="CQ"/>
                <t:ItemClass>IPM.Configuration.WorkHours</t:ItemClass>
              </t:Message>
              <t:Message>
                <t:ItemId Id="ADEz=" ChangeKey="CQ"/>
                <t:ItemClass>IPM.Configuration.Calendar</t:ItemClass>
              </t:Message>
              <t:Message>
                <t:ItemId Id="ADEz=" ChangeKey="CQ"/>
                <t:ItemClass>IPM.Microsoft.FolderDesign.NamedView</t:ItemClass>
              </t:Message>
            </t:Items>
          </m:RootFolder>
        </m:FindItemResponseMessage>
      </m:ResponseMessages>
    </m:FindItemResponse>
  </s:Body>
</s:Envelope>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!