Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Exchange 2010 Delete

Posted on 2011-09-27
5
323 Views
Last Modified: 2012-05-12
After having run an Export-Mailbox command I would like to now DELETE the exported email . . . so I can clean up the mailbox size. What is the correct command?

PS - If anyone knows I am having trouble with the syntax from a previous question
http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_27313428.html
0
Comment
Question by:Starquest321
  • 3
5 Comments
 
LVL 26

Accepted Solution

by:
e_aravind earned 250 total points
ID: 36718448
did you get a chance to run the commandlet with the option "delete content"?

Sample:
To find and delete items from a group of mailboxes, such as all mailboxes on a database, run the following command:

Copy Code Get-Mailbox -Database DB1 | Export-Mailbox -TargetMailbox ExportMailbox -TargetFolder VirusData -SubjectKeywords "Virus message" -DeleteContent

Reference:
http://technet.microsoft.com/en-us/library/bb266964(EXCHG.80).aspx
0
 
LVL 17

Expert Comment

by:lucid8
ID: 36718734
With 2010 SP1 and greater you have to use the Search-Mailbox command with the DeleteContent parameter. Check out http://technet.microsoft.com/en-us/library/dd298173.aspx
0
 

Author Comment

by:Starquest321
ID: 36936080
Will the search mail command also EXPORT the mail to a pst and delete the originals ALL in one command?
0
 
LVL 17

Assisted Solution

by:lucid8
lucid8 earned 250 total points
ID: 36936126
No alas they took that option away so you must do two commands if you want to export, however that said you can copy the results to a target mailbox and delete from source in one command.  

So you could set up a SearchTargetResults mailbox if you will, do the search for xxx then copy to SearchTargetResults mailbox and  delete from source.  Then use the export command to export the contents of the SearchTargetResults mailbox  
0
 
LVL 17

Expert Comment

by:lucid8
ID: 37030000
Thanks for the points!
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
In this video we show how to create an email address policy 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 Mail Flow…
how to add IIS SMTP to handle application/Scanner relays into office 365.

856 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