Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 938
  • Last Modified:

Delete ALL emails in the /Inbox from a command prompt

Is there a DOS command to delete all emails in the Inbox of Outlook for a user.

Here's the scenario, I have setup the Symantec Antispam on the Exchange server and redirected all spam messages to go to a email address spam@domain.com. This mailbox gets full VERY FAST and hence it gets difficult after a few days or weeks to delete all the messages from Inbox, in Outlook itself.

Please help. Thanks in advance.
0
gerriya3
Asked:
gerriya3
1 Solution
 
mass2612Commented:
Hi,

Your best bet from the shell is probably export-mailbox. You can export the contents of a mailbox to PST and also select to delete the data using the switches -DeleteContent or -DeleteAssociatedMessages.

Exchange 2007 SP1 Mailbox Management Features - Part 1: Importing and Exporting Mailbox data to and from PST files
http://www.msexchange.org/articles_tutorials/exchange-server-2007/management-administration/exchange-2007-sp1-mailbox-management-part1.html
0
 
omic_adminCommented:
so it wouldn't be easier to just attach the mailbox to your Outlook profile and just pressing Ctrl-A and delete regularly on that mailbox?
0
 
BrentDevOpsCommented:
I would just setup a recipient policy that uses the mailbox management process to delete all emails in that mailbox nightly.

http://www.msexchange.org/tutorials/Mailbox-Management.html 

Very handy in keeping users email boxes clean of deleted items and junk email too.
0
 
gerriya3Author Commented:
I want to do this on a regular basis, maybe everyday - AUTOMATICALLY (maybe put it as a scheduled task)
Omic_admin, I know it sounds easy...CTRL+A and delete but this Inbox gets filled with around 5-6 thousand spam emails a day and if we forget to delete the emails ... in a week or 2 there are close to 100,000 emails...
I am looking at Icetoad's idea....sounds like it could be it...but the link is for Exchange 2003, do you have the link for 2007...else I will just research myself...
Thanks everybody

0
 
BrentDevOpsCommented:
http://technet.microsoft.com/en-us/library/bb310756.aspx

in exchange 2007 its called Messaging Records Management
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now