Solved

How to delete e-mail from all exchange 2007 mailboxes

Posted on 2014-02-10
7
625 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

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…
PHP contact form that lets the user to contact the company through email contact form. A button is fixed at the bottom of site, on clicking a new window will open where a user can send the email.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

813 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

11 Experts available now in Live!

Get 1:1 Help Now