Sometimes one might need to delete many messages from one or more mailboxes. This might happen when trying to stop someone from reading an e-mail message you‘ve sent by mistake (assuming he or she didn‘t open his or her mailbox yet), deleting an infected attachment or even removing an appointment that was sent to 100 people by mistake.
Deleting one message from one mailbox isn‘t a hard thing to accomplish, but deleting hundreds of specific messages from hundreds of mailboxes found on many Exchange servers is sure to give a good headache to any system administrator.
For example, let‘s say I‘ve sent a message titles “This is a test message” with the attachment 70-720.doc to another user, and I want to delete this message before that user opens his or her mailbox.
Luckily for us, we can utilize the power of EXMERGE to delete these messages (and they do not need to be e-mail messages. In fact you can use EXMERGE to remove and delete any kind of object found inside your mailbox folders).
First, you need to obtain the correct version of EXMERGE for your Exchange server. EXMERGE first shipped with the Exchange 5.5 Resource Kit and the most recent version can be obtained from the latest Exchange 2000 Service Pack (SP3) and Exchange Server 2003 installation CD.
Note: To write this article I‘ve used Exchange Server 2003, Outlook 2003, and the latest version of EXMERGE, however the procedure is quite the same with previous versions.
After downloading the correct version of EXMERGE, extract the files found in it by using tools like WinZip or WinRAR. You will now need to copy EXMERGE.EXE to the %Program Files%\Exchsrvr\bin folder of your Exchange server.
Next, you need to configure your user account to have full mailbox rights for the specific mailbox/mailboxes that you want to open. On Exchange 2000/2003 the Exchange Full Administrator permissions does NOT, by default, allow you to open any other user‘s mailbox.
The above screenshot is an example of EXMERGE failure due to poorly configured permissions. Read Grant Full Mailbox Rights to an Administrator on Exchange 2000/2003 for more info.
To delete specific items from one or more mailboxes found on one Exchange server follow these steps:
You can also select a time and date range for the scanning operation.
I left both options blank because I wanted to scan the entire mailbox and go through all dates (when in fact I could have selected just the inbox, thus making the process run faster)
Note: I advise to always enter the exact phrase you‘re looking for (if you know it) and select the “Exact String Match”, so that you do not delete any other messages by mistake.
When you‘re done click Ok to go back to the “Source Server” dialogue box. Click Next
Note: In a scenario where you only have one mailbox store you will not be presented with this page.
Hebrew users note: To successfully utilize the power of EXMERGE when using Hebrew enabled servers with Hebrew-titled items and mailbox names you MUST follow the next tip: EXMERGE and Hebrew Fonts. Failing to do so might cause great damage to your exported mailboxes and to the names and titles of items within those mailboxes. Failing to do so will not harm the items that are in the original mailboxes, however items that were exported to the .PST files might turn out to be illegible.
Notice an example of a successful process:
If you get a window that states that there were one or more failures, such as this one:
then it‘s probably because of wrong permissions on the destination mailboxes. Re-read Grant Full Mailbox Rights to an Administrator on Exchange 2000/2003 and start from the beginning of the article.
Don‘t forget to delete the folder where you‘ve stored the deleted item(s) – see step #15 – it‘s just taking up free space on your hard disk.
One of our Petri KB readers, Mark G, emailed me the following suggestion about PST size and I think it is a great addition to this article:
I use exmerge to archive and delete old emails from my various clients exchange servers. It’s been my experience that an unsuccessful copy is due to the resulting PST file exceeding its limits. The Exmerge utility saves exchange items to an ANSI format PST and therefore has a limit of 2GB in size or 16K items (16,384) per Microsoft Support KB 208480. Often the export will reach the limit of the number of items before its size limit is reached. Often due to the size of a MailBox account and the volume of email to be archived it is too large to be exported to a single PST. So I export the contents to a multiple PSTs, broken up by smaller date ranges.