V
V
Vitaly2016-07-28 13:29:45
PowerShell
Vitaly, 2016-07-28 13:29:45

How to filter only external mail through Search-Mailbox?

Search-Mailbox -Identity $SearchMailbox -SearchQuery 'Received:28.07.2016 AND From:"@mydomain.com" AND To:"@mydomain.com"' -TargetMailbox $TargetMailbox -TargetFolder "SearchQueryTest9" -LogLevel Full
This works, but if there are external addresses among the recipients, such letters are not discarded. It is necessary through "AND NOT" to somehow exclude letters where among the recipients there are external addresses and show only internal-internal. Provided that it is impossible to enumerate all external domains. How?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question