Cleaning of my Exchange 2010 Mailboxes

Hi everybody,

For maintenance purposes, I need to empty all the mailboxes of my Exchange 2010 organisation.

For confidential reasons, I need that all the cleaned mails cannot be recovered, i want them to be definitively deleted.

How can I do ?


Who is Participating?
suriyaehnopConnect With a Mentor Commented:

Import-CSV C:\filename | foreach {New-MailboxExportRequest -Mailbox $ -FilePath "\\SERVER01\PSTFileShare\$($"}

Open in new window

To empty all the mailboxes, you may have to user Exchange Powershell to delete the content of mailboxes.

To cleaned the mails, you can configure at Database level:

Deleted Settings:

Keep deleted items for (days) : 0
AdmicomAuthor Commented:
Thanks !

Before to do this, how can I automatize the export to PST files for all the mailboxes ?
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

AdmicomAuthor Commented:
i dont have SP1 and it does not work. The commands seem to be unknown. Do i have to deploy it before ?

Exchange Server 2010 SP1
With the release of Exchange Server 2010 SP1 the export-mailbox cmdlet was replaced with new-mailboxexportrequest, it has similar requirements to export-mailbox, however it does not require Outlook to be installed.


Permissions assigned to user via RBAC
Exchange 2010 Management Tools Installed
.Net Framwork 3.5
PowerShell 3.5
Exchange Server 2010 Service Pack 1

If not SP1, you have to installed Outlook 64bit version on Exchange Mailbox  and use Export-Mailbox
AdmicomAuthor Commented:
Thks !

In fact I'd like a script that export all the mailboxes automatically...
AdmicomAuthor Commented:
When I try "export-mailbox" or "new-mailboxexportrequest", I have an error that tells me that the command is unknown. Would I have forgotten something ?
Simon Butler (Sembee)ConsultantCommented:
You really need to get your server up to date, as there are more modern commands and procedures with the later releases. RTM and SP1 are no longer supported, you need to be on 2010 SP2 or higher.

To use export-mailbox you have to be given specific permissions, being org admin or whatever is not enough. It is a specific permission. However I cannot recall what it is now as I don't retain knowledge of RTM/SP1 only commands.

AdmicomAuthor Commented:
Ok, great i managed to export all the mailbox.

Would you have the syntax to delete all the mails of a mailbox that are before the 1st of june 2013 for example ?
All Courses

From novice to tech pro — start learning today.