Solved

Exchange: Batch searching with EMS.

Posted on 2015-01-20
3
37 Views
Last Modified: 2015-02-01
I have multiple Exchange Servers and I need to search for specific keywords across emails and attachments.  I would like to use EMS and a batch file to perform this.

Does anyone know if this is possible, and if so if you could provide some examples?  The output that I am looking for is a listing of every item in exchange that is responsive to the keywords.

This is for Exchange 2010.
0
Comment
Question by:rye004
3 Comments
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
ID: 40561017
You can use the following script below to accomplish this.

NOTE: before running the script you need to run the command below...
New-ManagementRoleAssignment -Role "Mailbox Import Export" -SecurityGroup "YourSecurityGroupName"


This script will find all of the users in your domain and export each mailbox in its own PST file with any of the contents you are looking for.
$Mailbox = Get-Mailbox -ResultSize Unlimited
Foreach ($user in $Mailbox) {
New-MailboxExportRequest -Mailbox $user -ContentFilter {(body -like "*your txt here*")} -FilePath "\\SERVER\ShareName\$user.pst
}

Open in new window


Will.
0
 
LVL 3

Expert Comment

by:Rezwan Islam
ID: 40561287
You can try to do an exchange discovery search on all mailboxes via ECP or using the following on EMS. Make sure you have got the discovery management role group permission first (get-rolegroupmember -identity "Discovery Management").

New-MailboxSearch -Name "name this search" -StartDate "mm/dd/yyyy" -EndDate "mm/dd/yyyy" -TargetMailbox "target mailbox name" -SearchQuery '"content 1" and "content 2"' -MessageTypes Email -IncludeUnsearchableItems -LogLevel Full

This will create a search folder on the target mailbox and run a search against all mailboxes in your domain.

Ref: https://technet.microsoft.com/en-us/library/dd353189(v=exchg.141).aspx
0
 

Author Closing Comment

by:rye004
ID: 40583351
Thank you so much!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article runs through the process of deploying a single EXE application selectively to a group of user.
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 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