We help IT Professionals succeed at work.

Script to delete contents of a specified Exchange 2003 based Outlook Inbox permanently

ITWB
ITWB asked
on
Medium Priority
485 Views
Last Modified: 2010-04-08
Has anyone got a script that will delete the contents of a specified Outlook inbox permanently (ie not go into deleted items)?
Comment
Watch Question

Hi ITWB,

Select the contents of the whole folder (ctrl-A)
Press shift-delete
Confirm

In stead of the whole folder, you can select a selection of items by pressing ctrl and clicking with the left mouse button on each message you want to delete.

Lucky Luke

Author

Commented:
I need a script that actually deletes the contents of an outlook inbox without acrually opening Outlook and/or logging on as the user.
WadskiIT Director
CERTIFIED EXPERT

Commented:
Open AD
Delete the users entry (or just Exchange Mailbox)
Open Exchange System Manager
Navigate to the users mailbox
Run Cleanup Agent
Purge Users Mailbox.

Author

Commented:
No I don't wan't to delete a user's entry or mailbox, need mailbox to remain  active, I just want to be able to, say once a month purge it's contents.
Mate you need to use Exmerge.  Free MS app that can remove content from lots or single Mailbox.  Have a read here

http://www.msexchange.org/tutorials/MF013.html

Hope this helps

Rob
It's also scriptable with exmerge -b option. Have a read up on it but you'll find it a very useful tool for exchange

Rob

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Top Expert 2010
Commented:
Greetings, ITWB.

Have a look at this: http://www.outlookcode.com/codedetail.aspx?id=41

Cheers!
CERTIFIED EXPERT
Top Expert 2010

Commented:
ITWB,

> I need a script that actually deletes the contents of an outlook inbox
> without acrually opening Outlook and/or logging on as the user.

I hadn't seen this post when I posted my first comment.  This is impossible using Outlook or CDO unless you're an Exchange admin or the user has delegated access to their mailbox to you and you've added that mailbox to your Outlook profile.  You'd have to follow robjeeves' suggestion about using Exmerge or some other tool at the Exchange server itself.  

Commented:
Exmerge is an exchange utility that can be used to extract mail based on specific criteria .. suchb as a specific attachment, or subject line.

Mailbox manager can delete things from specific folders based on the time and date stamp.

If you hold the shift key down when you delete something in outlook, it will not go to the deleted items bin, but you may still recover it with the DumpsterAlwayson registry key.

To dump somebody else's, you need access, either delegate, or thru AD settings.

Just to expand on the subject, why do you want to delete everything in another users folder?  Maybe we can help another way.
Top Expert 2005

Commented:
Hi,

Are you using exchange?  If so what version??

You can do this using a recipeient policy in exchange.  Let me know what version you are running and I will give you the steps.

Stuart

Author

Commented:
Stuart - we are using Exchange 2003

Author

Commented:
Kjanicke - I want to delte mail from anotther users mailbox as those mailboxes are not "owned" by a person they are used for administrative purposes
Mate the answer has been given - two options;

Exmerge -b line or use Mailbox manager. As i suggested 1st Exmerge is my tool of choice but the suggestion of mailbox manager is equally suitable.  No need for scripting.  Either of these tools will do exactly what you need.

Hope this helps

Rob

Commented:
Or if you are an admin guy, give yourself access to the mailbox.

Commented:
You could make a VB script in outlook to delete the mail from inbox, then delete it again from Deleted Items.. However it would have to be run on the outlook client in question.
Top Expert 2005

Commented:
Ok, herers how ti do it on exchange.  Create a new mailbox store, move the mailbox in question to this store, the create a recient policy on the store to do a regular mail box clean up.  There are a number of options you can choose but the ones you should be looking at are the ones to permanently delete and set it to run every month.

I dont have an exchange 2003 set5up to hand, so am doing this from memory.  If you need  more help, let me know and I'll set up a test bench.

Stuart
Top Expert 2007

Commented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:
SPLIT robjeeves {17856789} & BlueDevilFan {17856960}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

michko
Experts Exchange Cleanup Volunteer
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.