locked
Search & List all the mailboxes for specific word in the subject line RRS feed

  • Question

  • Hi I am looking for a command that will search and list all the mailboxes for a specific word in the subject line.

    The results should be listed on the screen or export to csv/txt.

    Any help would be much appreciated, thank you.

    Monday, November 26, 2012 10:24 AM

Answers

  • Hi 

    you can use below command 

    Get-Mailbox -Server  "MBX1" -ResultSize Unlimited | Search-Mailbox -SearchQuery 'Subject:"*Important Message*"' -targetmailbox "Admin" -targetfolder "SearchResult" -logonly -loglevel full

    It will check all mailboxes on server MBX1 for messages with subject Important Message and it will write log to Admin mailbox to folder SearchResult

    This log is in .csv or .xml


    Remigiusz
    ExchangeBlog


    • Edited by Remigiusz_Sz Wednesday, November 28, 2012 10:41 AM
    • Marked as answer by abudha Wednesday, November 28, 2012 12:34 PM
    Tuesday, November 27, 2012 1:56 PM

All replies

  • Hi

    check this article

    Remove specific messages from Exchange 2010 Server

    you will find how to search all mailboxes on server and remove email with specified subject


    Remigiusz
    ExchangeBlog

    Monday, November 26, 2012 3:17 PM
  • Hi abudha,

    Any updates?


    Frank Wang
    TechNet Community Support

    Tuesday, November 27, 2012 6:41 AM
  • thank you all for your time

    Is there anyway to just search and list those mailboxes with particular word in the subject field rather than delete those messages.

    Tuesday, November 27, 2012 1:36 PM
  • See:

    get-help search-mailbox

    Use the information from the links already provided, and the help files to adjust the -deletecontent, -loglevel, and -logonly parameters to meet your requirements.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    Tuesday, November 27, 2012 1:49 PM
  • Hi 

    you can use below command 

    Get-Mailbox -Server  "MBX1" -ResultSize Unlimited | Search-Mailbox -SearchQuery 'Subject:"*Important Message*"' -targetmailbox "Admin" -targetfolder "SearchResult" -logonly -loglevel full

    It will check all mailboxes on server MBX1 for messages with subject Important Message and it will write log to Admin mailbox to folder SearchResult

    This log is in .csv or .xml


    Remigiusz
    ExchangeBlog


    • Edited by Remigiusz_Sz Wednesday, November 28, 2012 10:41 AM
    • Marked as answer by abudha Wednesday, November 28, 2012 12:34 PM
    Tuesday, November 27, 2012 1:56 PM
  • hi, this is what happens when I type following command. After hitting enter I get >> in next line.

    [PS] C:\Windows\system32>Get-Mailbox -Server  "AUS-MBX-01" -ResultSize Unlimited | Search-Mailbox -SearchQuery 'Subject
    :"*Try this*" -targetmailbox "barrowt" -targetfolder "SearchResult" -logonly -loglevel full;
    >>
    >>
    • Marked as answer by abudha Wednesday, November 28, 2012 12:33 PM
    • Unmarked as answer by abudha Wednesday, November 28, 2012 12:33 PM
    Wednesday, November 28, 2012 10:30 AM
  • you miss ' after Try This*"

    should be Try This*"'


    Remigiusz
    ExchangeBlog


    • Edited by Remigiusz_Sz Wednesday, November 28, 2012 10:41 AM
    Wednesday, November 28, 2012 10:41 AM
  • thank you very much.

    Wednesday, November 28, 2012 12:33 PM