Microsoft Exchange Server 2016 PowerShell Cookbook - Fourth Edition
by Jonas Andersson, Nuno Mota, Mike Pfeiffer
How it works...
The code in this example is very similar to what we used in the recipe for Searching mailboxes. Again, since we are not supplying credentials when creating the ExchangeService object, and we're not using impersonation, the search will be performed in the administrator mailbox. When calling the FindItems method, we're specifying the folder to search, the AQS search query to be used, and the item view.
For each item returned by the search, we need to create a new view and property set for the single instance of the message that returns only the message headers. We then bind to the message and return the header information.
The header information returned will provide details of which server received the message, the content ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access