Powershell command - delete a folder from an mailbox

We have an mailbox that just collects data from mailbox searches, we would like to purge some of this data from the mailbox, do I have any options via the powershell to accomplish this.

Thanks in advance

May 10th, 2013 12:55pm

Hi

If you want to delete folder from mailbox then you need to use EWS library and Powershell. 

There is no other option. 

But if you want to remove only messagess from mailboxes then use:
search-mailbox with option -deletecontent

Free Windows Admin Tool Kit Click here and download it now
May 10th, 2013 1:37pm

Hi,

You may use the following cmdlet to delete all the contents of the inbox and all the sub folders inside

get-mailbox -Identity name | Export-mailbox -DeleteContent -IncludeFolders "\Inbox"

May 10th, 2013 5:19pm

Hi

Check this EWS Script and see if it will help dont forget the user run the command must have full access permission to target mailbox

http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/bc07df23-64f1-4732-a399-76fd39b1595e

Cheers

If you have any feedback on our support, please click here

Free Windows Admin Tool Kit Click here and download it now
May 13th, 2013 2:22am

Hi,

You may use the following cmdlet to delete all the contents of the inbox and all the sub folders inside

get-mailbox -Identity name | Export-mailbox -DeleteContent -IncludeFolders "\Inbox"		
May 30th, 2013 11:48pm

Thanks Mike for the good catch
Free Windows Admin Tool Kit Click here and download it now
May 31st, 2013 2:37am

Hi All, 

Does anyone have the answer for the Exchange 2013 powershell solution to deleting the contents of a specific folder?

Kind regards, Scott.

August 12th, 2015 11:32am

Your going to have to use EWS or a 3rd party product
Free Windows Admin Tool Kit Click here and download it now
August 12th, 2015 12:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics