Solved

how to search multiple exchange databases for a received email and move them to a specific folder

Posted on 2013-05-16
8
241 Views
Last Modified: 2013-08-13
is it possible to search 4 mailbox databases on exchange 2007
for an email from a specific sender
and either delete them all
and give a report how many were deleted
0
Comment
Question by:dougdog
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
Comment Utility
There is no Search feature like we have in Exchange 2010

http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_25891756.html
Export-Mailbox "UserMailbox" -Senderkeywords "senderemail" -Deletecontent

http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/ec8fec31-bafa-42c0-b9ed-cd328747391d

- Rancy
0
 

Author Comment

by:dougdog
Comment Utility
so what would be the exact command i would need to search all databases for an email sent from sender@yahoo.co.
and move them into a folder called recall on my mailbox
0
 

Author Comment

by:dougdog
Comment Utility
or if that cant be done just delete all emails from the sender
0
 
LVL 52

Assisted Solution

by:Manpreet SIngh Khatra
Manpreet SIngh Khatra earned 167 total points
Comment Utility
Get-Mailbox -ResultSize Unlimited | Export-Mailbox -Senderkeywords "senderemail" -Deletecontent

just check if this helps

- Rancy
0
Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

 
LVL 40

Expert Comment

by:Subsun
Comment Utility
0
 

Author Comment

by:dougdog
Comment Utility
will this search mailboxes on 2007 and 2010
I was around 80% on 2007

and 20% on 2010

also would this command be safe to run
I was a little worries when it started saying moving and deleting

Get-Mailbox | Export-Mailbox -SubjectKeywords "movinghouse" -DeleteContent
0
 
LVL 2

Assisted Solution

by:DonYoung
DonYoung earned 166 total points
Comment Utility
I've used the following script to do that:

$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://ServerName/PowerShell/ -Authentication Kerberos
Import-PSSession $s
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -erroraction SilentlyContinue
$lines = Get-Content "c:\TEMP\removal.txt" #text file of mailboxes
foreach ($line in $lines) {
	Search-Mailbox -identity $line -SearchQuery Subject:'text_to_find1'-DeleteContent -Force:$True 
	Search-Mailbox -identity $line -SearchQuery Subject:'text_to_find2'-DeleteContent -Force:$True 
	}

Open in new window

0
 
LVL 40

Accepted Solution

by:
Subsun earned 167 total points
Comment Utility
Export-Mailbox command is supported in Exchange 2007 and Search-Mailbox for Exchange 2010.

For example, if you want to delete a specific mail with sender address subsun@test.com with subject line ”I am back”, then you can use the following command. The command will move the emails to TargetMailbox specified in command (TempMailbox folder To Delete) and then delete the specified content from the user mailboxes.

You may also use -StartDate & -EndDate parameters to specify the dates which you want to search email (to narrow down the search).

Example will search for the specified email on server EXCH.
Get-Mailbox -Server EXCH | Export-Mailbox -TargetMailbox TempMailbox -TargetFolder ”To Delete” -SenderKeywords subsun@test.com -SubjectKeywords ”I am back” –StartDate “12/30/10" –EndDate “12/31/10" –DeleteContent –MaxThreads 10

Open in new window

0

Featured Post

Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
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 …
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

743 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

15 Experts available now in Live!

Get 1:1 Help Now