Delete Mailbox folders from Exchange
Hi
I have a group of mailboxes that we use for special purposes all containing some folders that we need to delete.
Technically, I could add them all to my Outlook profile and delete them manually but that would take ages.
Does anyone know if it's possible to delete folders within a mailbox using Powershell?
For instance - mailbox name "Mailbox1" contains a folder named "2001" under the Inbox that I want to delete. Any suggestions on now to do this? I've actually tried to do this on one mailbox, and the 2001 folder was so large that my Outlook keeps hanging.
Server is Exchange 2007 SP2. Also need to make sure that running this command doesn't hang Exchange!
February 15th, 2011 1:45am
My understaing is you can not remove folder until all items are deleted from that particular folder.Best Rgds, Ashish | Unified Comunication | MCTS | MCITP | Please remember to select option "Propose As Answer" if solution work for you | My posts hold no assurances, no promises, and they measured no rights.
Free Windows Admin Tool Kit Click here and download it now
February 15th, 2011 8:57am
Hi
I think you will have to create a "script" using the EWS and API's that goes through the mailbox(es) and deletes this folder if it exists
Here's a link that might be helpful for you, but you will have to change it so it matches your requirements
http://www.mikepfeiffer.net/2011/01/creating-calendar-items-with-powershell-and-the-ews-managed-api/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+MikePfeiffer+%28Mike+Pfeiffer%27s+Blog%29
Jonas Andersson MCTS: Microsoft Exchange Server 2007/2010 | MCITP: EMA 2007/2010 | Blog:
http://www.testlabs.se/blog | Follow me on twitter:
jonand82
February 15th, 2011 10:20am
Thanks...so there is no command that works similar to:
Get-mailbox -identity xx | remove-folder XXXX
Something like that?
Free Windows Admin Tool Kit Click here and download it now
February 15th, 2011 11:42am
Unfortunately not AFAIK..
I think you have to build something to do that work for youJonas Andersson MCTS: Microsoft Exchange Server 2007/2010 | MCITP: EMA 2007/2010 | Blog:
http://www.testlabs.se/blog | Follow me on twitter:
jonand82
February 15th, 2011 11:44am
Hi,
As per my knowledge and test, there is no built-in command can help you delete the folder from a mailbox directly. An alternate way what I think is using command Export-Mailbox to export the content
of the subfolder and log on to Outlook delete the subfolder in your scenario.
For using Export-Mailbox, please see
http://technet.microsoft.com/en-us/library/aa998579(EXCHG.80).aspx
Best regards,
SerenaPlease remember to click Mark as Answer on the post that helps you, and to click Unmark as Answer if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Free Windows Admin Tool Kit Click here and download it now
February 16th, 2011 6:09am
I'm sorry to bring this tread back online.
But since SP1 of Exchange 2010, they remove the deletecontent parameter.
Is there any other solutions that someone know to perform this task ?
March 23rd, 2012 11:33am