Become a Columnist Microsoft Exchange Site Microsoft Support SiteMSDN Exchange Site

       How did you like this article? Please vote and let us know.          

Subscribe to OutlookExchange
Anderson Patricio
Ann Mc Donough
Bob Spurzem
Brian Veal
Catherine Creary
Cherry Beado
Colin Janssen
Collins Timothy Mutesaria
Drew Nicholson
Fred Volking
Glen Scales
Goran Husman
Guy Thomas
Henrik Walther
Jason Sherry
Jayme Bowers
John Young
Joyce Tang
Justin Braun
Konstantin Zheludev
Kristina Waters
Kuang Zhang
Mahmoud Magdy
Martin Tuip
Michael Dong
Michele Deo
Mitch Tulloch
Nicolas Blank
Pavel Nagaev
Ragnar Harper
Ricardo Silva
Richard Wakeman
Russ Iuliano
Santhosh Hanumanthappa
Shannal L. Thomas
Steve Bryant
Steve Craig
Todd Walker
Tracey J. Rosenblath

 

 
 

Combined Content filter and Mailbox Crawl Script    Download Script

This script combines ideas from my previous 2 articles content filter and scanning script and mailbox crawl script. To create a content scanning script for attachment types that can crawl through a entire mailbox store or certain mailboxes and provide reporting on or removal of certain attachment types. 

How it works

For full details on both scripts please see my previous articles – Let take a look at the changes that have been made to both scripts in order to combine them and get them to work as required.

The front end of the code is just a conglomeration of the two scripts and deals with setting up the necessary ADO connections and monitor mailbox. Note you need to make changes to the monitor mailbox here. (set it to your own mailbox and change the backoffice storage value to that of your domain)

The major change is in the second select statement where additional parameters have been added so only messages that have attachments are selected.

                        strView = "SELECT ""DAV:displayname"",""DAV:href"""
                        strView = strView & "FROM scope ('shallow traversal of """& workfolder & """') "
                        strview = strview & " WHERE ""DAV:isfolder"" = false AND ""urn:schemas:httpmail:hasattachment"" = True"
                        rs1.CursorLocation = 3 'adUseServer = 2, adUseClient = 3

The rest of the code basically is the same as the cscan.vbs script and makes a copy of any messages found in the mailbox being scanned to the monitor mailbox.

Running this script

To execute this script you can use a batch file or just execute it from the command line with the mailbox alias as the parameter eg mcraw1.vbs mailboxalias

Extending this script

Other modifications that can be made to this script include creating an extended log file detailing what is stored in your mailbox store eg attachment type, size , from-where. You could also add code that deletes certain types of attachments from the information store. For example this script could be handy if the information store had been infected by a virus to help in the removal of infected attachments.

Download Script


Disclaimer: Your use of the information contained in these pages is at your sole risk. All information on these pages is provided "as is", without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Pro Exchange. OutlookExchange.Com and Pro Exchange shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.

© Copyright Pro Exchange, Inc., 2006