If you’ve ever had to write any scripts that query the message tracking logs though WMI you may have come across the issue that WQL cant handle doing a Where clause on an array. Because the Recipient address’s on an email are returned as an array when you want to use this class to make a query that only shows mail that is going to one address it can be a little cumbersome. With Powershell although you are still stuck not being able to filter via recipient address in a WMI query what you can do now is pipe that result to the where-object cmdlet where you can then filter the result to one particular recipient address. If you combine this in a script what you can then do is query the tracking logs for the past x number of hours to show any email sent to a particular recipient. The reverse is also true you can query to see all the email sent from a particular address. What I’ve done is put two scripts together that do this both scripts take 3 input parameters the first is the name of the s...
Pushing the Envelope in Messaging and Office 365 Development