Solved

Exchange: Batch searching with EMS.

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
This article explains how to install and use the NTBackup utility that comes with Windows Server.
To show how to create a transport rule 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 >> Rules tab.:  To cr…
To show how to generate a certificate request 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 Servers >> Certificates…

786 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