Solved

How to delete e-mail from all exchange 2007 mailboxes

Posted on 2014-02-10
7
623 Views
Last Modified: 2014-02-10
I need to delete a specific e-mail from all mailboxes in my exchange 2007 organization. The user sent out an e-mail that needs to be deleted and then sent a recall to outlook. Most of the recalls failed. Then the user sent another e-mail with identical subject and body with the correct attachments. I need to delete the first e-mail with the wrong attachment. I tried using the following commands.

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

I also tried the subject switch but when I run these commands it appears to be pulling over much more then just the one e-mail per user that needs to be deleted. This was discouraging so I canceled it because I didn't want to accidentally delte e-mails from several users.

What is the best/easiest way to delete the one specific e-mail without catching everything else that might have a similar keyword?

Thanks,

Justin
0
Comment
Question by:JustinGSEIWI
  • 3
  • 3
7 Comments
 

Author Comment

by:JustinGSEIWI
ID: 39847783
I used this link.

http://exchangeshell.wordpress.com/2009/08/10/export-mailbox-for-deleting-content-from-mailboxes/

I also found this text in the link.

"It should also be noted that as long as you are running Exchange 2007 SP2, the ‘keyword’ command will catch all mail items that contain the keyword ANYWHERE in the field, regardless of spacing. So for example, if you are using -SubjectKeywords “Viagra” this will be a hit for “Viagra Cheap”, “Get yourViagraHere” and “     **  Viagra  **”."

This must of been the issue I had with other e-mails that were unrelated being deleted from the users mailbox. I need a way to just delete one specific e-mail, not all e-mails with the same keyboards.
0
 
LVL 53

Assisted Solution

by:Will Szymkowski
Will Szymkowski earned 250 total points
ID: 39847837
You are using the most appropriate method cmdlet for removing the content. I would just tighten the command to only look for a specific data/time. You can use -StartDate and -EndData and you can also use -SenderKeywords.

This will narrow your search results for you so that you can delete the appropriate email/s needed.

Use get-help export-mailbox -full and look at the -StartDate, -EndDate and -SenderKeywords switches.

Will.
0
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 250 total points
ID: 39847840
I would give this a shot.

get-mailbox | Export-Mailbox –ContentKeywords "message" –TargetMailbox Administrator –TargetFolder 'MyData' -startdate (date/time) -enddate (date/time) –DeleteContent

You can put in the start and end date to specify a really small window. Hopefuly the person who sent this message did not send them immediately after each other. I would say if you had a window of a minute or so you should be ok.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:JustinGSEIWI
ID: 39847949
I am trying the following command now.

get-mailbox | Export-Mailbox –ContentKeywords "message" –TargetMailbox Administrator –TargetFolder 'MyData' -startdate (date/time) -enddate (date/time) –DeleteContent

I am going to use an acronym in the e-mail subject because that would not of been used very often. I am also doing a start date or yesterday so it will parse all e-mails today. It is hard to narrow a window because the user did a delayed send for 8am this morning but the e-mail is time stamped in my inbox at 8:17, which is when the user did the recall.

I am testing it on my inbox and it says it is moving message deleted items 390/40984. I read this as it is moving my entire deleted items to the admin mailbox. Is that correct or no? This is was discouraged me initially, I didn't want all e-mails being deleted from the users inbox.
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 39847959
For your content keywords switch are you using a single word or phrase? I believe you can use a phrase in the email that way it only targets the messages you are interested in.
0
 

Author Comment

by:JustinGSEIWI
ID: 39847973
I tried the phrase but then it started deleting other e-mails that matched the words in the phrase. Even though I used the start date command, it is still going through my entire deleted items folder. Why is that? Shouldn't it just do items for today? I used the following command. Did I use it correctly?

et-mailbox | Export-Mailbox –ContentKeywords "PSLF " –TargetMailbox Administrator –TargetFolder 'MyData' -startdate 02/09/14 –DeleteContent
0
 
LVL 35

Expert Comment

by:Joseph Daly
ID: 39848005
I'm on 2010 right now so I can't test but if I remember correctly it will process all the messages but only remove the matches.

I would try this on your mailbox let it run to completion and then see. If I remember it should only do the matches and not ge whole mailbox. I think this scared me when I did it too.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now