8

Quick Tip - Searching Exchange Message Tracking Logs (Get Results From Every Ser...

 3 years ago
source link: https://thomasrayner.ca/quick-tip-searching-exchange-message-tracking-logs-get-results-from-every-server/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Quick Tip - Searching Exchange Message Tracking Logs (Get Results From Every Server)

When you use the Get-MessageTrackingLog cmdlet, by default, it only searches for messages/events on the server that you’re connected to (see my post on creating connections to Exchange). That’s not great in a multi-server environment. I want results from every server.

My solution is the following.

$results = $null
get-transportservice | foreach-object { $results += Get-MessageTrackingLog -server $_.Name -start (get-date).addhours(-1) -end (get-date) -resultsize unlimited | Select-Object -Property eventid,serverhostname,sender,recipients,messagesubject,timestamp }
$results | Sort-Object -Property Timestamp | ft 

The Get-TransportService cmdlet gets a list of all the transport servers in your infrastructure. For each of the servers we get back, I’m running the Get-MessageTrackingLog cmdlet and appending the results to a $results variable. I’m taking that results collection and sorting it chronologically.

Written on July 8, 2015

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK