Powershell script to strip attachments?
I have a client that wants to strip all attachments from his mailbox. I am aware that you can remove them manually, but he has thousands of emails with attachments so this is clearly not an option. Is there a powershell command I can run that
will find and remove all attachments from his mailbox while leaving the original message intact?
July 8th, 2010 6:20pm
http://technet.microsoft.com/en-us/library/bb266964%28EXCHG.80%29.aspx is the link to export-mailbox. It has an -AttachmentFilenames parameter
that you can call out.
"mjwoolley" wrote in message
news:ad634759-a112-4b7f-a8e1-46d0a2d97d16...
I have a client that wants to strip all attachments from his mailbox. I am aware that you can remove them manually, but he has thousands of emails with attachments so this is clearly not an option. Is there a powershell command I can run that will
find and remove all attachments from his mailbox while leaving the original message intact?Mark Arnold, Exchange MVP.
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2010 6:42pm
I found that, but I don't think it accomplishes my goal. When you export with -AttachmentFilenames does it actually export the attachment and remove it from the message, or does it just export messages with that filename? If it only exports based
on filename and leaves the attachment on the message then this does not meet my goal.
July 8th, 2010 6:51pm
Did you read to the -deletecontent part? Now, what I am not 100% clear on is whether the -deletecontent tears out only the attachment and leaves the message or takes out both. Someone might chime in with that or you could maybe test
it.
"mjwoolley" wrote in message
news:bc35aeb8-15f6-490a-b179-b9abf56184bb...
I found that, but I don't think it accomplishes my goal. When you export with -AttachmentFilenames does it actually export the attachment and remove it from the message, or does it just export messages with that filename? If it only exports based
on filename and leaves the attachment on the message then this does not meet my goal.
Mark Arnold, Exchange MVP.
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2010 8:14pm
Hi,
If you use Export-Mailbox with -AttachmentFilenames and -DeleteContent, the whole mails will be deleted.
Seems like there is no native function to meet you needs using Exchange server.
Similar post, please see:
http://social.technet.microsoft.com/Forums/en-US/exchangesvrcompliance/thread/e79024fd-e913-45e9-a0ab-5c8eed49764fFrank Wang
July 13th, 2010 8:41am