Automating Mailbox cleanup with Exmerge, ExmergeINI, and VBScript

I have a financial client that receives a lot of email notifications from brokerage firms.  They subscribe to the messages using a distribution list that is accessible to remote clients.  Unfortunately, we didn't set up a separate distribution list just for this purpose so other messages are being received.

The problem is that they get about 14,000 messages a week that are distributed in all of their analysts' mailboxes and it takes up to 20 minutes for each of them to do a weekly cleanup.  They could automate this using outlook archive rules, but that process slows down their outlook client when it is running. God forbid they are away from the office for a few weeks and now they have all of these messages to (a) sync with their mailbox and (b) then delete.

The client had a requirement that they only keep the last 14 days of messages received (NOTE: all email is archived automatically for compliance reasons and so they can delete anything from their mailboxes without worry).

Several people suggested EXMERGE, but EXMERGE didn't have a mechanism to filter on sender and receipient addresses (i.e. the DL in this case). It also uses fixed dates.  I found a small utility called EXMERGEINI. ExmergeINI makes it easy to modify items in the EXMERGE.INI file from the command line.  Since the dates that EXMERGE requires is fixed, I wrote a small VBScript that will launch ExMergeINI.EXE and programatically change the date based on today's date and then run EXMERGE.

Set WshShell = WScript.CreateObject("WScript.Shell")

Datenow = Date
newdate = DateAdd("d",-14,datenow)
exmergeparams = "exmergeini.exe SelectMessageEndDate """ + Cstr(newdate) +  " 23:59:59"" -f ""c:\program files\exchsrvr\bin\exmerge.ini"" "
WshShell.Run exmergeparams,1,TRUE

wshshell.Run "ExMerge.exe -B -F exmerge.ini",1,TRUE

 

 What I requested that each mailbox that wanted to participate was to create a folder with a specified name and create the rule that would move those notifications to that folder.  This script would then delete messages that are older than 14 days in that folder for each participating mailbox.

I'm sure there are other ways to skin this that wouldn't impact the users desktop. Let me know if you have any.

201-297-7778



877-572-9969