Solved

Exchange: Batch searching with EMS.

Posted on 2015-01-20
3
33 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Easy CSR creation in Exchange 2007,2010 and 2013
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

757 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

22 Experts available now in Live!

Get 1:1 Help Now