none
Find Item in shared folder with EWS RRS feed

  • Question

  • Hi,

    How can i find an item in a shared folder with EWS. I manage to get the messages in my inbox and sent items but i cant figure out how to access the shared folders (attached picture). I run this soap at the moment.

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" 
        xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" 
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <t:RequestServerVersion Version="Exchange2013_SP1" />
      </soap:Header>
      <soap:Body>
        <m:FindItem Traversal="Shallow">
          <m:ItemShape>
            <t:BaseShape>IdOnly</t:BaseShape>
            <t:AdditionalProperties>
            <t:FieldURI FieldURI="item:StoreEntryId" />
              <t:FieldURI FieldURI="item:Subject" />
              <t:FieldURI FieldURI="item:DateTimeReceived" />
              <t:FieldURI FieldURI="message:From" />          
            </t:AdditionalProperties>
          </m:ItemShape>
          <m:IndexedPageItemView MaxEntriesReturned="100" Offset="0" BasePoint="Beginning" />
          <m:Restriction>
            <t:And>
              <t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
                <t:FieldURI FieldURI="item:Subject" />
                <t:Constant Value="1239373" />
              </t:Contains>
            </t:And>
          </m:Restriction>
          <m:SortOrder>
            <t:FieldOrder Order="Descending">
              <t:FieldURI FieldURI="item:DateTimeReceived" />
            </t:FieldOrder>
          </m:SortOrder>
          <m:ParentFolderIds>
            <t:DistinguishedFolderId Id="inbox" />
            <t:DistinguishedFolderId Id="sentitems" />        
          </m:ParentFolderIds>
        </m:FindItem>
      </soap:Body>
    </soap:Envelope>

    Thanks in advance!


    • Edited by Ollza Monday, April 29, 2019 6:43 AM
    Monday, April 29, 2019 6:43 AM

Answers

  • Well I've been working in IT since the 90's so yeah it would make sense to me.

    Probably the best suggestion i would have is look at the EWSEditor https://github.com/dseph/EwsEditor/releases . You can connect to mailboxes and Shared mailboxes using this and then if you look at the logs (in the menu EWS Log viewer)  you will be able to see the request and response in XML that it returns. Also if you look at the install directory for the utility there is a folder called EwsPostExamples which has XML sample of all the request and it also has an editor you can try XML out in.

    Cheers
    Glen

    • Marked as answer by Ollza Friday, May 3, 2019 12:09 PM
    Thursday, May 2, 2019 11:02 PM

All replies

  • Hi,

    You can convert normal mailbox to resource mailbox using below command

    Set-Mailbox -Identity "Conference Room 01" -Type Room


    Thanks & Regards, Kumar N

    Monday, April 29, 2019 8:13 AM
  • You need to find the EWSId's of the Target folder and put them in place of this in your code

          <m:ParentFolderIds>
            <t:DistinguishedFolderId Id="inbox" />
            <t:DistinguishedFolderId Id="sentitems" />        
          </m:ParentFolderIds>

    eg make use of the Mailbox Node of DistinguishedFolderId https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/distinguishedfolderid

    Cheers
    Glen



    Tuesday, April 30, 2019 4:51 AM
  • I cant figure out how to get the EWS Id of this shared folder. Any idea?
    Tuesday, April 30, 2019 5:48 AM
  • You need to show what you have tried and the code your not just the XML.  To Find a particular folder in a Mailbox you would use the FindFolder operation, if its a well known folder then you can just use the DistinguishedFolderId but because you haven't posted a code sample it hard to help point you in the direction of any particular samples.

    Cheers
    Glen

    Tuesday, April 30, 2019 11:53 PM
  • I dont have any code yet. I try in SOAP UI and when i get the correct query i will produce this XML in my code. My code will not make any sense for you beacuse it is an own developed code language from the 90´s...
    Thursday, May 2, 2019 5:14 AM
  • Well I've been working in IT since the 90's so yeah it would make sense to me.

    Probably the best suggestion i would have is look at the EWSEditor https://github.com/dseph/EwsEditor/releases . You can connect to mailboxes and Shared mailboxes using this and then if you look at the logs (in the menu EWS Log viewer)  you will be able to see the request and response in XML that it returns. Also if you look at the install directory for the utility there is a folder called EwsPostExamples which has XML sample of all the request and it also has an editor you can try XML out in.

    Cheers
    Glen

    • Marked as answer by Ollza Friday, May 3, 2019 12:09 PM
    Thursday, May 2, 2019 11:02 PM
  • Ok, thanks. I will take a look.
    Friday, May 3, 2019 12:10 PM