Home

EWS Timing out Emptying Deleted Items Folder

Deepak Kumar Vasudevan
Occasional Visitor

Dear Team,

 

I am trying to empty my DeletedItems folder on Office365 through OWA. It just ignores my requests and next refresh I see still all emails are there. Outlook client takes a long time to download because in DeletedItems there are around 40 GB of emails.

 

Hence I wrote a small piece of console application 

 

using Microsoft.Exchange.WebServices;
using Microsoft.Exchange.WebServices.Auth;
using Microsoft.Exchange.WebServices.Data;

 

service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");

 

(Autodiscover takes a long time and hence caching this URL)

 

Folder fldDeletedItems = Folder.Bind(service, WellKnownFolderName.DeletedItems);
fldDeletedItems.Empty(DeleteMode.HardDelete, false);

 

And this .Empty line is throwing the following exception 

 


Additional information: The request failed. The operation has timed out

 

How do I go about emptying the DeletedItems folder?

 

Thanks and Regards,

 

Deepak 

1 Reply

I guess you can try deleting them in batches? Another thing that comes to mind is create/apply a retention tag to have those items deleted server-side.

 

Or open a support case and have them look at this, it's not like we didn't warn them the decision to remove the retention policy on the Deleted Items folder will cause problems with Outlook...

 

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies