Link to home
Start Free TrialLog in
Avatar of nick_o78
nick_o78

asked on

Deleting content from individual mailbox Exchange 2013

Hi,

I am trying to reduce individual mailboxes in Exchange 2013 but having trouble deleting content. In Exchange 2007 you could export mail and than delete content....this command does not work in the latest version of Exchange.

I have tried several commands using the Search-mailbox command and it doesn't work yet gives a success once completed but deletes no content and give 0 for ResultItemcount and Resultitemsize.

Any help would be great...

Thanks,
Rob
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

You are on the right track when you are using "Search-Mailbox". Below is an example right from the Search-Mailbox Help within Powershell. This would be for an individual user.

Search-Mailbox -Identity "April Stewart" -SearchQuery 'Subject:"Your bank statement"' -DeleteContent

Open in new window


The good thing about Exchange 2013 over 2007 is that the content is deleted from the mailbox and does not need to be copied to a PST file or another mailbox before the content is removed from the original source.

Will.
Avatar of nick_o78
nick_o78

ASKER

Thanks for that....although I am trying to delete by date and am using the following command :
Search-mailbox -identity "windows" -SearchQuery "Received:<$('2014/12/31')" -deletecontent

It runs successfully....and even has a Success : True yet the resultitemcount and resultitemsize is zero.

But I know there are emails in that mailbox for that data range.

Thanks,
Rob
SOLUTION
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial