Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How do we remove attachments from the Exchange store

Posted on 2011-10-13
15
Medium Priority
?
471 Views
Last Modified: 2012-06-21
We have users sending large files to multiple people. Sometimes these are just junk and i would like to troll the store and remove the attachment from the store and replace it with a message perhaps (Admin removed). Message optional. This should also help reduce the size of the store from what i can tell.  As a second question is there a way to find all email with a subject and remove it from the store as well? Please keep in mind i do not want to do this at the client level i need to be able to do this from the server so attachment striping programs are not what i am after.
0
Comment
Question by:Wdntulk2no-
  • 8
  • 6
15 Comments
 
LVL 8

Expert Comment

by:Salah Eddine ELMRABET
ID: 36962847
Hi,

For the size limit you can configure quota using the maximum file size that can be allowed, so the emails exceeding this limit will be droped.

Else for the filtering by subject, you have to use and anti spam solution and configure custom rules to do so.

Regards.

Salah
0
 
LVL 6

Expert Comment

by:Sid_F
ID: 36963056
To remove mail per subject exmerge is the best tool
http://www.petri.co.il/delete_messages_from_mailboxes_by_using_exmerge.htm
0
 

Author Comment

by:Wdntulk2no-
ID: 36964310
selmrabet: The size limit isn’t the issue here or the filtering of the email. the issue is the message already exists.

Sid_F: The exMerget tool looks to be for EX 03 and below. There are ways of making it work but i would prefer to do it native to the version we have. (2007) There are over 2000 boxes on this server so using something other than an official way is kind of scary.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 8

Expert Comment

by:Salah Eddine ELMRABET
ID: 36965291
Hi,

do you have open relay configured on your exchange? are you sure the emails are from trusted users or from a spamer?
0
 

Author Comment

by:Wdntulk2no-
ID: 36965325
These are from internal users. To make a long story short some goober forwarded an attachment to a bunch of users. Basically not an attachment we want in or from our server, but sadly they are trusted users and nope no open relays last time i checked.
0
 
LVL 8

Expert Comment

by:Salah Eddine ELMRABET
ID: 36965356
so you have to install an anti spam solutions and define a customized rule as I told you before ex block email that are sent to certain number of destination
0
 

Author Comment

by:Wdntulk2no-
ID: 36965424
Again this isn’t a normal practice. We don’t want to prevent our users from sending attachments. or restrict them from sending to a certain number of people.

--The objective here is to purge this one email / attachment from the store from all mailboxes. Not to stop them from sending the email or sending email to multiple people or even anything to do with the size of the email or attachment.

0
 
LVL 8

Expert Comment

by:Salah Eddine ELMRABET
ID: 36965531
Hi again,

The solution for you is to use EXMERGE to delete the email and or attachment from all mailboxs on the exchange store, here is some url including tutorials and how to:

http://www.petri.co.il/delete_messages_from_mailboxes_by_using_exmerge.htm

http://www.intelliadmin.com/index.php/2007/10/remove-an-email-from-all-mailboxes-in-microsoft-exchange/

Good luck.

Salah
0
 

Author Comment

by:Wdntulk2no-
ID: 36971130
As Previsouly stated i do not want to use a tool that was not desinged for Ex2k7. It may work but this is not something i want o fight with. Why can we not use the powershell??

These commands seem to be logical but they do not "find" the messages:

Get-Mailbox -Database TN_Mailboxes | Export-Mailbox -TargetMailbox SpamBox -TargetFolder SuspectMessages -SubjectKeywords "This is the message that you want to delete" -DeleteContent

Get-Mailbox jtest | Export-Mailbox -TargetMailbox SpamBox -TargetFolder SuspectMessages -SubjectKeywords "This is the message that you want to delete " -DeleteContent

Get-Mailbox jtest | Export-Mailbox -SubjectKeywords "company" -DeleteContent
0
 
LVL 8

Expert Comment

by:Salah Eddine ELMRABET
ID: 36971488
Hi,

You mean that you tried withou getting any result?? else make a backup and run the tool I think this will solve the problem!

BR
0
 

Author Comment

by:Wdntulk2no-
ID: 36979344
There wasn’t an expected result from the above scripts, it did however create a mirror of the directory structure of the users mailbox folder tree.
0
 

Author Comment

by:Wdntulk2no-
ID: 36980075
OK so i have shortend the script a bit just to play with it:

This exports one box to the other:
Get-Mailbox jtest | Export-Mailbox -TargetMailbox dtest -TargetFolder SuspectMessages

This does the same thing except it deletes all the messages in the source:

Get-Mailbox jtest | Export-Mailbox -TargetMailbox dtest -TargetFolder SuspectMessages  -DeleteContent

I cannot seem to use the -SubjectKeywords  switch

If i were to use -SubjectKeywords "Test" I would expect it to locate all messages with TEST in the subject copy then delete them is this about right?
0
 
LVL 8

Accepted Solution

by:
Salah Eddine ELMRABET earned 1500 total points
ID: 36981022
Hi,

ExMerge is not supported by Ex2K7 the exchange add most functionalities of ExMerge on SP1!! this is confirmed, for the cmdlets you can use the Get-Mailbox with the syntax you show in your topic (with the -SubjectKeywords) if you have SP1 some filters are supported on Ex2K7 without SP.

So the solution is to apply SP1 and run the command with the syntax:

Get-Mailbox -Database DB1 | Export-Mailbox -SubjectKeywords "Virus message" -DeleteContent

to delete and export :

Get-Mailbox -Database DB1 | Export-Mailbox -TargetMailbox ExportMailbox -TargetFolder VirusData -SubjectKeywords "Virus message" -DeleteContent

for more details refer to the follwing technet library:

http://technet.microsoft.com/fr-fr/library/bb123685%28EXCHG.80%29.aspx

Best Regards.

Salah
0
 

Author Comment

by:Wdntulk2no-
ID: 36981078
Already running SP1

Version 8.1 (Build 240.6)
A bit behind but should work, i Guess i will update the SP to a later one and see how that goes.
0
 

Author Closing Comment

by:Wdntulk2no-
ID: 37179147
No fault to selmrabet, i am no longer able to help with this question. I no longer have access to this server and will most likleybe moving to 2010. I am unsure if his solution would have worked or if the upgrade to the SP would have fixes it. I feel it is unfair to not give him the points for effort.
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

This article describes Top 9 Exchange troubleshooting utilities that every Exchange Administrator should know. Most of the utilities are available free of cost. List of tools that I am going to explain in this article are:   Microsoft Remote Con…
Today as you open your Outlook, you witness an error message: “Outlook is using an old copy of your Outlook Data File…”. Probably, Outlook is accessing an old OST file.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

577 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