EWS Java API recover emails RRS feed

  • Question

  • I'm using EWS Java API in my project. I want to recover and fetch recently deleted items using EWS Java API. I can do this using Office 365 web interface. What is the corresponding EWS Java API call to do this?
    Friday, February 5, 2016 12:45 PM

All replies

  • The Exchange recoverable items are held in a folder in the mailbox.  Recovering an item from there is the same as moving it from there to a folder in the active (i.e., the "Outlook visible") mailbox.  I had to recover all calendar items for all mailboxes in our company a while back (due to changes in Exchange retention), and found a script I modified.  here's the link to that script:  You should be able to read through it to determine how to recover individual items.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Friday, February 5, 2016 2:35 PM
  • Hi Will,

    Thank you for the response. I'll try the post you gave. The folder which is holding the recoverable items is a well known folder?

    Saturday, February 6, 2016 3:20 PM
  • The command that attaches the folder in the script is:

     $FolderId = New-Object Microsoft.Exchange.WebServices.Data.FolderId( [Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::RecoverableItemsDeletions, $mbx )

    Yes, it's a well known folder.  I suggest you download the script and read through it so you can see where both the recoverable items are handled, as wellk as where any other folders are.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Monday, February 8, 2016 1:32 PM
  • Thanks Will, By referring to your code I wrote my own one and now it's working. :)
    Tuesday, February 9, 2016 10:07 AM
  • Glad to help out.  Feel free to mark the response(s) that answered your question.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Tuesday, February 9, 2016 3:44 PM