• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 622
  • Last Modified:

EXCHANGE 2010 DELETE EMAIL TOOL

I need to find and delete an email from all mailboxes. Wrongfully sent to the company distribution list.
0
whocaresaboutit
Asked:
whocaresaboutit
  • 5
  • 3
  • 3
1 Solution
 
whocaresaboutitAuthor Commented:
Anybody know of a third party tool I can use for this?
0
 
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:
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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
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

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 5
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now