?
Solved

Deleting messages based on subject keywords

Posted on 2014-07-18
5
Medium Priority
?
147 Views
Last Modified: 2014-07-21
I am looking to manage size of inboxes by auto deleting messages that have a certain subject line after say 30 days.
0
Comment
Question by:Brazilee
[X]
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
  • 2
  • 2
5 Comments
 
LVL 29

Expert Comment

by:becraig
ID: 40205769
Get-Mailbox -ResultSize Unlimited | Export-Mailbox -ContentKeywords "<subject line here>" -TargetMailbox MyBackupMailbox -StartDate "06/18/2014" -EndDate "07/18/2014" -TargetFolder '<folder Name>' -DeleteContent

Open in new window

0
 
LVL 7

Accepted Solution

by:
Murali Reddy earned 1400 total points
ID: 40205983
There are two disadvantages of using above commad
1- exporting contents to a common mailbox, do you really need it?
2- it is exporting and deleting one month's range (-StartDate "06/18/2014" -EndDate "07/18/2014") emails only.


I'd suggest you use search-mailbox with AQS something like,

Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery {(subject:<SubjecttoQuery>) AND (Sent:01/01/2000..06/19/2014) AND (Received:01/01/2000..06/19/2014)} -DeleteContent

if you want a copy of it or you want to just log thedetails, use some thing like'

Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery {(subject:<SubjecttoQuery>) AND (Sent:01/01/2000..06/19/2014) AND (Received:01/01/2000..06/19/2014)} -TargetMailbox Administrator -TargetFolder SearchLogs -LogOnly -LogLevel Full



## I put some old date top have the range cover all the emails olderthan 30 days. you choose accordingly.

First you use -logonly parameter to see if you are getting the exact results and then proceed to delete.
0
 

Author Comment

by:Brazilee
ID: 40206496
Can I use this command to affect the entire company (information store) rather then one mailbox?
0
 
LVL 29

Expert Comment

by:becraig
ID: 40206510
The command I gave you is for all mailboxes.

If you want for a single mailbox you would have to specify the user Identity.

For a specific server specify server.

Some good reading to help you better understand the get-mailbox command:
http://technet.microsoft.com/en-us/library/bb123685%28v=exchg.150%29.aspx
0
 
LVL 7

Expert Comment

by:Murali Reddy
ID: 40206955
Get-mailbox -Resultsize Unlimited | ***** yes, this is for all mailboxes in your organization.

if you want for a specific mailbox
get-mailbox -identity "Mailbox identity" |******
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
In this video we show how to create an Address List 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 Organization >> Ad…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

765 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