Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Newly created Mailbox giving unexpected results

$
0
0

I am facing a strange issue where I need help. I have written a backup solution that backups Exchange online items on disk using ExportItems EWS method. Once the mailbox backup is complete, I delete the mailbox.  Next, I restore the mailbox, I use Windows Azure AD powershell cmdlets to Create the new mailbox in Exchange Online. When the mailbox is created. I query Exchange Online using Get-SearchableMailboxes EWS method to check if the mailbox
exists.

Next, I use Uploaditems (EWS method) to restore items to this new mailbox.  But before restoring items I check if the items to be restored already exist in the target mailbox using FindItems()
If they exist I do not restore them. Surprisingly, the items are always found to be  existing in the mailbox which is contrary to the expected results. Is it possible that EWS is returning these results from the deleted mailbox ? 

I am facing a similar issue for same solution for Exchange On-premises server 2013.
1. If I use admin credentials to restore items after the new mailbox is created I get an Error - Impersonation failed.
The first attempt to restore mailbox from backup after deletion of the mailbox is always successful.
However, the next attempts to restore mailbox from backup after deletion of the newly created mailbox always fails with the error Impersonation failed.

2. If I use the newly created mailbox credentials to restore items (i.e. without impersonation), EWS finds that the items already exist in the newly created mailbox. Ideally the newly created mailbox should have no items that were backed up. It is a similar behavior to what we found in Exchange Online.

Can anyone please suggest a solution or a workaround to address this issue.

Regards,

Gagan


Gagan


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>