Solved

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

Posted on 2006-11-02
18
467 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)?
0
Comment
Question by:ITWB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +6
18 Comments
 
LVL 10

Expert Comment

by:LuckyLuke57
ID: 17856498
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
0
 

Author Comment

by:ITWB
ID: 17856550
I need a script that actually deletes the contents of an outlook inbox without acrually opening Outlook and/or logging on as the user.
0
 
LVL 16

Expert Comment

by:Wadski
ID: 17856614
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.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:ITWB
ID: 17856629
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.
0
 
LVL 9

Expert Comment

by:robjeeves
ID: 17856783
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
0
 
LVL 9

Accepted Solution

by:
robjeeves earned 250 total points
ID: 17856789
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
0
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 250 total points
ID: 17856960
Greetings, ITWB.

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

Cheers!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17856990
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.  
0
 
LVL 18

Expert Comment

by:kjanicke
ID: 17857511
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.
0
 
LVL 11

Expert Comment

by:StuartWhyte
ID: 17857978
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
0
 

Author Comment

by:ITWB
ID: 17859942
Stuart - we are using Exchange 2003

0
 

Author Comment

by:ITWB
ID: 17859953
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
0
 
LVL 9

Expert Comment

by:robjeeves
ID: 17860436
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
0
 
LVL 18

Expert Comment

by:kjanicke
ID: 17862019
Or if you are an admin guy, give yourself access to the mailbox.
0
 
LVL 4

Expert Comment

by:MikeSel
ID: 17921024
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.
0
 
LVL 11

Expert Comment

by:StuartWhyte
ID: 17926236
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
0
 
LVL 27

Expert Comment

by:michko
ID: 19650225
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
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question