Solved

Remove all messages on Exchange Mailbox

Posted on 2013-01-20
4
315 Views
Last Modified: 2013-01-21
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
Comment
Question by:AXISHK
  • 2
4 Comments
 
LVL 10

Expert Comment

by:joelsplace
ID: 38799889
Use Search-mailbox with the -deletecontent switch:
 
http://technet.microsoft.com/en-us/library/dd298173.aspx
0
 

Author Comment

by:AXISHK
ID: 38799897
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
 
LVL 10

Accepted Solution

by:
joelsplace earned 300 total points
ID: 38799903
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
 
LVL 15

Assisted Solution

by:Rajkumar-MCITP
Rajkumar-MCITP earned 200 total points
ID: 38800774
export-mailbox -identity "john" -PSTFolderPath c:\temp\Exchange -Deletecontent
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now