Link to home
Create AccountLog in
Avatar of Malli Boppe
Malli BoppeFlag for Australia

asked on

delete all mail for all users in exchange 2010

Is their a way to delete all mail for all users in exchange 2010 SP1. The reason for this is as test I have imported all the mail (through PSTs) from our current domain to the new domain. So would like to delete all the mail and start again .
Avatar of Hendrik Wiese
Hendrik Wiese
Flag of South Africa image

Create a backup mailbox and run the following replacing "MyBackupMailbox" with your backup mailbox name:

Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -IncludeFolders "\Inbox" -StartDate "09/07/2010" -EndDate "09/09/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false

Open in new window

Or you could try this as well (I have not tested it though):

Get-Mailbox | Export-Mailbox -DeleteContent

Open in new window

Avatar of Malli Boppe

ASKER

Export-mailbox has been removed from exchange 2010 SP1.
Have you tried, again have not tested it, but let me know if it works?:

Get-Mailbox -Server “your server” | Search-Mailbox -DeleteContent

Open in new window

If ou dont need the public databse content then you can simply delete the DB file.. :)
ASKER CERTIFIED SOLUTION
Avatar of Akhater
Akhater
Flag of Lebanon image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Thanks for the points