I am looking for a script that can do the following:
Search All Mailboxes in our Exchange 2007 Environment for a specific attachment
Log the mailboxes that the search returned
Ensure that the file is deleted from my exchange environment
In exchange 2010 I could do the following:
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery attachment:trojan* -TargetMailbox Administrator -TargetFolder SearchLogs -LogOnly -LogLevel Full
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery attachment:trojan* -DeleteContent
However in Exchange 2007 I am not sure how to accomplish this.
I need this in two seperate scripts:
Search all mailboxes for the attachment and export results that include Mailbox Name to a log file
Search all Mailboxes and for the attachment and delete the message containing the attachment.