EXCHANGE 2010 DELETE EMAIL TOOL

I need to find and delete an email from all mailboxes. Wrongfully sent to the company distribution list.
whocaresaboutitAsked:
Who is Participating?
 
Ron MalmsteadInformation Services ManagerCommented:
Seems like a job for powershell...


PS> get-mailbox | Export-Mailbox –ContentKeywords "Virus message" –TargetMailbox Administrator –TargetFolder 'MyData' –DeleteContent

http://blogs.technet.com/b/exchange/archive/2006/12/18/3397563.aspx
0
 
whocaresaboutitAuthor Commented:
Anybody know of a third party tool I can use for this?
0
 
whocaresaboutitAuthor Commented:
can you help me modify it so that it affects all mailboxes, all folder, all databases (I have three DBs)?

can we do keyword in subjectline?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
sunnyc7Commented:
you can run this from powershell in Exchange 2010

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

I'd run the query first without -DeleteContent, and pipe it to text file - just to make sure I am not deleting anything else.
Search-Mailbox -Identity "April Stewart" -SearchQuery 'Subject:"Your bank statement"' > C:\list.txt
Then i can run it with -DeleteContent switch

http://technet.microsoft.com/en-us/library/dd298173.aspx

PS: Your question is for Exchange 2010 and you posted it on SBS Queue.
SBS 2008 comes with exchange 2007
SBS 2011 comes with exchange 2010

0
 
Ron MalmsteadInformation Services ManagerCommented:
Awesome sunnyc7.

..nailed it...
0
 
sunnyc7Commented:
Thanks :)
0
 
whocaresaboutitAuthor Commented:
sunnyc7.... can you change it so that identity switch is applied to all users/mailboxes and all db's?
0
 
Ron MalmsteadInformation Services ManagerCommented:
....are all db's in the same organization ?

I think search-mailbox applies to the entire scope of the organization so all servers and db's included in AD..
0
 
sunnyc7Commented:
fyi - the user should have discovery role assigned to execute this.
0
 
whocaresaboutitAuthor Commented:
yes all DBs are on the same organization... current command Search-Mailbox -Identity "April Stewart"  ...applies only to April's mailbox, right?

how do i check if discovery role is assigned?
0
 
whocaresaboutitAuthor Commented:
not working, this is what Im getting:

[PS] C:\Windows\system32>Search-Mailbox -Identity "John Doe" -SearchQuery 'Subject:"text of subject line of msg sent"' > C:\test\list.txt
The target mailbox or .pst file path is required.
    + CategoryInfo          : InvalidArgument: (:) [], ArgumentException
    + FullyQualifiedErrorId : 7850297B

[PS] C:\Windows\system32>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.