Are you most interested in deleting the folder itself, or the contents of the 
folder? If it's the contents, you should be able to use a managed folder 
mailbox policy.

For deleting the folder, you simply have to bind to the folder and then call 
the delete method. There is code for doing that in the SDK. The most difficult 
issue is creating an appropriate service account - EWS is an absolute stickler 
for getting impersonation exactly right.

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

From: Kretche, Peter [mailto:kretc...@uwgb.edu]
Sent: Wednesday, July 28, 2010 8:41 AM
To: MS-Exchange Admin Issues
Subject: Deleting a folder from all mailboxes

Does anyone know of a way to delete a folder in all mailboxes using Powershell? 
 We used Sunbelt VIPRE (back to the days of iHateSpam) and we've since moved on 
to Forefront.  If I ask users to delete the folder I expect very few will 
actually do it.

I have a feeling deleting a folder in all mailboxes directly with Powershell 
isn't possible, I'm guessing I need to invoke EWS through Powershell (which I 
have no idea how to do).  I've seen EWS code online for C# and I admit I'm not 
strong enough in programming to put it all together.  If anyone has any tips or 
already invented this wheel and is willing to share I appreciate it.

-------------------------------------------------
Thank you,
Peter Kretche
University of Wisconsin - Green Bay

Reply via email to