exchangewebservices

EWS: "Not allowed to access Non IPM item" when trying to get IPM.SkypeTeams.Message from RecoverableItemsSubstrateHolds


Is there any way to get items (IPM.SkypeTeams.Message) from the substrate hold folder.

FindItem request:

<m:FindItem Traversal="Shallow">
    <m:ItemShape>
      <t:BaseShape>IdOnly</t:BaseShape>
      <t:AdditionalProperties />
        <t:FieldURI FieldURI="item:ItemClass" />
        <t:FieldURI FieldURI="item:LastModifiedTime" />
        <t:FieldURI FieldURI="item:Size" />
      </t:AdditionalProperties>
    </m:ItemShape>
    <m:IndexedPageItemView MaxEntriesReturned="1000" Offset="0" BasePoint="Beginning" />
    <m:ParentFolderIds>
      <t:DistinguishedFolderId Id="recoverableitemssubstrateholds" />
    </m:ParentFolderIds>
  </m:FindItem>

FindItemResponse:

<t:Message>
  <t:ItemId Id="AA...+CrAAA=" />
  <t:ItemClass>IPM.SkypeTeams.Message</t:ItemClass>
  <t:Size>30922</t:Size>
  <t:LastModifiedTime>2024-04-24T04:12:17Z</t:LastModifiedTime>
</t:Message>

GetItem request:

<m:GetItem>
  <m:ItemShape>
    <t:BaseShape>IdOnly</t:BaseShape>
  </m:ItemShape>
  <m:ItemIds>
    <t:ItemId Id="AA...+CrAAA=" />
  </m:ItemIds>
</m:GetItem>

GetItemResponse:

      <m:GetItemResponse>
        <m:ResponseMessages>
          <m:GetItemResponseMessage ResponseClass="Error">
            <m:MessageText>Not allowed to access Non IPM item.</m:MessageText>
            <m:ResponseCode>ErrorAccessDenied</m:ResponseCode>
            <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
            <m:Items />
          </m:GetItemResponseMessage>
        </m:ResponseMessages>
      </m:GetItemResponse>

Solution

  • Accessing Teams messages is not longer allowed via EWS https://learn.microsoft.com/en-us/exchange/troubleshoot/send-emails/ews-not-support-access-teams-data . You'll get simular error messages if you try to access the TeamsChatHistory or TeamsMessageData folders. Depending on the age of the content the Teams Export API may not work (but you can at least test it for free before deciding whether you want to pay). Another option maybe a compliance search https://learn.microsoft.com/en-us/purview/ediscovery-teams-investigation