Exchange Powershell DeleteContent

Hello,

i try to delete the inbox and send folder with a powershell command. Its important that i can specify a date.

I try this command:

Search-Mailbox -Identity "Username" -SearchQuery '(Received:07/02/2013..07/03/2013)' -deletecontent -force

This command work but it remove nocht only received messages, this delete notes contact too....

I found the SearchQuery parametes but i think i cant use one of them.

http://help.outlook.com/en-us/140/ms.exch.ecp.newmailboxsearch_searchquery%28d=loband%29.aspx

Does anyone have an idea?

July 3rd, 2013 10:15am

check this link

Search-Mailbox kind Advanced Query Syntax AQS

I think you should use kind:email to remove only emails.

Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2013 10:38am

Thanks for this info

i worked now with:

Search-Mailbox -identity "Username" -SearchQuery '(received:01/02/07..07/07/07) AND (kind:email)' -DeleteContent -force

July 5th, 2013 2:11am

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

Other recent topics Other recent topics