Tuesday, 26 March 2013

Automatically empty "Deleted items" folder, Exchange 2007

What:

Microsoft SBS 2008 with Microsoft Exchange 2007

Problem:

Users are keeping hundreds of emails in Deleted Items folder.

Solution:

1. Open up "Exchange Management Console" and navigate to:
Organization configuration -> Mailbox -> Managed Default Folder
Right click on "Deleted Items" and add "New Managed Content Settings"


2. Create a "New Managed Folder Mailbox Policy" call it "Remove deleted items" and add "Deleted Items" folder in that policy.

3. Now assign newly created policy to all mailboxes.
Open up  "Exchange Management Shell" and use the following command.
Get-mailbox | set-mailbox -ManagedFolderMailboxPolicy "Remove deleted items"
To apply policy to a single mailbox called "test" use:
Set-Mailbox -Identity test -ManagedFolderMailboxPolicy "Remove deleted items"
For a single mailbox you can also use "Exchange Management Console":
Recipient configuration -> Mailbox
Double click on selected mailbox and go to "Mailbox Settings" tab, select "Messaging Records Management" and click Properties & assign policy.

4. Create schedule, in the "Exchange Management Console" navigate to:
 Server configuration -> Mailbox -> <Server Name>
Right click on your server and select "Properties", switch to "Messaging Records Management" tab and use a custom schedule.

You may need to force the policy to run with "Start-ManagedFolderAssistant" from "Exchange Management Shell" simply by typing in:
Start-ManagedFolderAssistant
Command used without parameters will process all the mailboxes on the local server.

Following examples will use list of servers or selected mailbox only.
Start-ManagedFolderAssistant -Identity ExchSrvr1, ExchSrvr2
Start-ManagedFolderAssistant -Mailbox test

  • Deleted Item Retention   Allows you to recover items after they have been removed from the Deleted Items folder or hard-deleted. You must configure the Exchange server for deleted items retention, and the item recovery must occur during the retention period. In Exchange 2007, the default retention period is 14 days. The actual recovery of the deleted items is done from the client.
  • Deleted Mailbox Retention   Allows you to recover mailboxes after they were deleted. You must configure the Exchange server for deleted mailbox retention, and the mailbox recovery must occur during the retention period. In Exchange 2007, the default retention period is 30 days. You can perform the actual recovery of the deleted mailbox by using either the Exchange Management Shell or the Exchange Management Console.

Source

5 comments:

  1. Thank u, this post has been very helpful

    ReplyDelete
  2. thanks awesome instructions!

    ReplyDelete
  3. It doesn't work for me. When I run the script I get the error '"Remove deleted items" does not exist'. This will only work if the policy exists in "Managed folder mailbox policies". Can't see what I've done wrong...

    ReplyDelete
  4. It sounds like you skipped step 2, go to Organization configuration -> Mailbox -> Managed Folder Mailbox Policies "Remove deleted items" policy should be there with associated Deleted Items folder.

    ReplyDelete