• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 326
  • Last Modified:

Remove all messages on Exchange Mailbox

After exporting the mails for a mailbox in Exchange 2007, what shell command can be used to clean up all the message for the mailbox ?

Tks

export-mailbox -identity "john" -PSTFolderPath c:\temp\Exchange
0
AXISHK
Asked:
AXISHK
  • 2
2 Solutions
 
joelsplaceCommented:
Use Search-mailbox with the -deletecontent switch:
 
http://technet.microsoft.com/en-us/library/dd298173.aspx
0
 
AXISHKAuthor Commented:
Search-Mailbox -Identity "test" -SearchQuery -DeleteContent

'Search-Mailbox" is not recognized as a cmdlet, function, opperable program or script file.

Any idea ? We are running Exchange 2007. Tks
0
 
joelsplaceCommented:
I didn't realize that doesn't work on pre 2010.
This should:
Get-content c:\11MailboxesList.txt | Get-mailbox | Export-Mailbox -DeleteContent
 
 http://msexchangeteam.com/archive/2006/11/28/431669.aspx
0
 
Rajkumar-MCITPCommented:
export-mailbox -identity "john" -PSTFolderPath c:\temp\Exchange -Deletecontent
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

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