Link to home
Start Free TrialLog in
Avatar of jay davis
jay davis

asked on

power shell mailbox specific search

I need to search 2 email mailboxes for search terms and specific dates how can i do this in power shell on the server
Avatar of ITguy565
ITguy565
Flag of United States of America image

This should give you all the information you need:

https://docs.microsoft.com/en-us/microsoft-365/compliance/search-for-and-delete-messagesadmin-help

This will allow you to search and delete the content that you find.. If you don't want to delete it just remove the -DeleteContent switch off the end.

Search-Mailbox -Identity "April Stewart" -SearchQuery 'Subject:"Your bank statement"' -TargetMailbox "BackupMailbox" -TargetFolder "AprilStewart-DeletedMessages" -LogLevel Full -DeleteContent -whatif

Open in new window

Here Is another site that might assist you with this :

https://thoughtsofanidlemind.com/2014/10/17/using-search-mailbox-to-look-for-items-with-a-specific-date/

Get-Mailbox –Database VIP –ResultSize Unlimited | Search-Mailbox -TargetMailbox AdminSearchMailbox -TargetFolder “Search Results” -SearchQuery {Subject:"Interesting" AND From:"Ben Andrews" AND Sent:"10/13/2014"} -DeleteContent -LogLevel Full –SearchDumpster -whatif

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.