Empty All Exchange 2007 Mailboxes


Empty All Exchange 2007 Mailboxes

by Brad Fair

The Problem

Today, I needed to remove all the mail from every mailbox on an SBS 2008 Exchange server, mostly because I didn’t really like that the server sent a welcome email to each user giving them links to things we won’t be implementing. After a lot of Googling, I found the PowerShell command “Export-Mailbox” can do this for me. When I ran the command, I ran into some errors that weren’t very useful:

Command I ran: Get-Mailbox | Export-Mailbox -DeleteContent


StatusMessage                    : Error occurred in the step: Moving messages.
Failed to copy messages to the destination
mailbox store with error:
MAPI or an unspecified service provider.
ID no: 00000000-0000-00000000
ReportFile : C:Program FilesMicrosoftExchange ServerL

The Solution

So after quite a while of more Googling, I found that this generic and almost useless error message is telling me that I don’t have permission to the mailbox in the first place, so I can’t delete any of the messages. Despite my being Administrator, here’s what I did to get past this issue altogether.


  1. Right click the Exchange Management Shell, and select Run as Administrator (this is a handy trick).
  2. Type the command “Get-Mailbox | Add-MailboxPermission -accessrights fullaccess -user Administrator” – if prompted, apply to ALL objects.
  3. Type the command “Get-Mailbox | Export-Mailbox -DeleteContent” – if prompted, apply to ALL objects.
  4. Type the command “Get-Mailbox | Remove-MailboxPermission -accessrights fullaccess -user Administrator” – Select “NO” when prompted about the Administrator mailbox! You can select “YES” for all other mailboxes, or apply to all if you want.
Hope this helps, and I hope it helps you delete all mail from mailboxes in Exchange 2007, just like it did for me!


More About the Author

Brad Fair

Solutions Architect
Webcast Friday: Tableau Server Performance Monitoring On the second ever Webcast Friday that InterWorks has produced, I had the honor of speaking to our web audience about Tableau Server ...
The Desktop User’s Guide to Tableau Server Are you a Tableau Desktop user who is new to Tableau Server? Do you find yourself confounded by all of the thingamajigs and whatsits, ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK


Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072


Love our blog? You should see our emails. Sign up for our newsletter!