How do I write a request to search for emails in Exchange?

Dmitry Shumov 1 Reputation point
2020-06-09T09:31:24.397+00:00

Colleagues, we need help with PowerShell for Exchange:
Trying to search for and then delete mail within the mail system.
This is a very basic task, but has been made more difficult by the fact that the body of the e-mail I am searching for has a "+" character in the text.

For example:
Get-Mailbox -Identity "user" | Search-Mailbox -SearchQuery body: 'Машина+' -EstimateResultOnly | export-csv -Delimiter ";" -encoding UTF8 C:\temp\test.csv
You need the right syntax for the team that searches the mailbox for content, given that the search query has a "+" sign.

There are letters with text in the box:
Machine+
Machine
Machine +

Of these, for example, you only need to find
"Machine+"
And in a separate search.
"Machine +"

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,935 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Laude 85,651 Reputation points
    2020-06-09T09:37:02.92+00:00

    Hi,

    Q&A currently supports the products listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).

    You can reach the experts in the dedicated Microsoft Exchange forum over here:
    https://social.technet.microsoft.com/Forums/en-us/home?category=exchangeserver

    (Please don't forget to mark helpful replies as answer)

    Best regards,
    Leon

    0 comments No comments