Searching Exchange 2010 mailboxes with Powershell

#Assign the role to the required user account
New-ManagementRoleAssignment -Role “Mailbox Import Export” -User administrator
#Restart the shell

#This would search every mailbox for messages containing the word secrets in the message body,
#and export them to the administrator mailbox in a subfolder called Export
Get-Mailbox -ResultSize Unlimited | Search-Mailbox -SearchQuery “Body:’*secrets*’” -TargetMailbox administrator -TargetFolder Export
#Or, to search one mailbox for bob smith
Search-Mailbox -Identity bsmith -SearchQuery “Body:’*secrets*’” -TargetMailbox administrator -TargetFolder

#you can also do this via ECP
#see http://technet.microsoft.com/en-us/library/dd298014.aspx

Share
About

Jeremy Whittaker is a Senior Consultant for N2 Network Solutions, a leader in Arizona computer consulting. Specializing in Exchange 2010, Cisco networking, and IT outsourcing.

Tagged with: , ,
Posted in Exchange

Leave a Reply