delete content from mailbox folder

How can I delete a folder and contents from a mailbox?

I guess it is with Search-Mailbox, but how do I target a folder and contents?

April 30th, 2015 3:56am

You could use Outlook.

According to this reference you can use the folderpath query term.  I haven't tested it.

http://www.howto-outlook.com/howto/searchcommands.htm

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 4:01am

Ed's suggestion is good if you want to work from within Outlook for a single mailbox, however if you are looking to do that as an Admin from Exchange then; 
  1. If you are looking to target content within a specific folder you would use the Search-Mailbox along with -DeleteContent parameter as outlined here https://technet.microsoft.com/en-us/library/ff459253%28v=exchg.150%29.aspx NOTE: Look at the bottom of the article for "What do you want to do?" and then expand the "Search and delete messages" section and there are specific examples to follow for your desired intent
  2. If you are looking to remove the entire folder & its contents from a mailbox, that's not possible 
April 30th, 2015 8:51am

Hi,

Check the EWS Script in the following link to see if it will be helpful for you.

Dont forget to grant full access permission to your account on target mailbox

https://social.technet.microsoft.com/Forums/windowsserver/en-US/bc07df23-64f1-4732-a399-76fd39b1595e/powershell-exchange-2010-delete-folder-in-mailbox-or-delete-mail-in-certain-folder?forum=winserverpowershell

Best Regards.

Free Windows Admin Tool Kit Click here and download it now
April 30th, 2015 10:42pm

Hi, I saw that one, but how do I focus the search on one folder and subfolders?
May 1st, 2015 1:47am

My post gave you a suggestion.
Free Windows Admin Tool Kit Click here and download it now
May 1st, 2015 12:34pm

Correct, I could do from Outlook. In this case there was another mailbox of 250MB restored to a folder called "Restored" and deleting from Outlook was painful. I was looking for a Server based solution.

I did delete this folder from Outlook in the end, but I still looking for a Server based solution for next time. I will look into EWS solution.

May 1st, 2015 8:33pm

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

Other recent topics Other recent topics