Recalling E-Mail from all user mailboxes in Exchange Server 2010 | Mailbox Import and Export | Deleting Specific e-mail from all users mailboxes

Author: Zahir Hussain Shah, MVP Exchange

As a messaging administrator, you may often get a task to re-call an e-mail from all users mailboxes, and when you try it always fails. At times things becomes critical due to the urgency of the message recalling request from higher management, and especially it becomes more frustrating when the same query is working for re-calling one e-mail message but not for the one, for which you want to re-call.

So what is the problem? Why its not working?
Well there is a problem with the Advance Query Syntax (AQS), which is a known problem. So when CMDLet works for you with one e-mail message recalling, then it means that the combination of the Subject, Sent, and From filed doesnt much different set of characters, and thus your query doesnt get wrong, but when it comes to the emails where lots of characters are in use, which makes the query full of special and other characters, sometimes your syntax goes wrong.

You can use the below Exchange Management Shell CMDLET to re-call or delete a specific email from all the users mailbox:

Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery “Subject:EMAIL SUBJECT From:HelpDesk@domain.com Sent:6/21/2012” -DeleteContent -TargetMailbox “Restore-Mailbox” -TargetFolder “inbox” -loglevel full

Note: Instead of using semi-column, you should use spaces between different criteria for query.
For more information about Advance Query Syntax (AQS) read this.

Cheers!

singature_blog.png

Leave a comment