In several recent articles I’ve demonstrated different techniques for searching message tracking logs using PowerShell.
- Searching Message Tracking Logs by Time and Date Range
- Searching Message Tracking Logs by Sender or Recipient Email Address
- Searching Message Tracking Logs by Email Subject
In each of those examples we mostly looked at searching the logs on a single Hub Transport server.
If your Exchange Server environment has more than one Transport server then you’ll often need to run message tracking log searches across multiple servers at once.
One of the simplest ways to do this is by piping the output from Get-TransportServer into the Get-MessageTrackingLog command.
[PS] C:\>Get-TransportServer | Get-MessageTrackingLog -MessageSubject "meeting" -resultsize unlimited}
If you’re running older Exchange Server 2007 hosts with PowerShell v1.0 on them then that is your only option for multi-server searches, and I recommend you use date/time ranges to speed up searches if you need to.
However if you have PowerShell v2.0 on your servers, then you can speed up your searches quite a lot by using PowerShell remoting.
Compare the time taken for these two searches of the same set of Transport servers.
[PS] C:\>measure-command {Get-TransportServer | Get-MessageTrackingLog -MessageSubject "meeting" -resultsize unlimited} Seconds : 25 [PS] C:\>measure-command {Get-TransportServer | Invoke-Command {Get-MessageTrackingLog -MessageSubject "meeting" -resultsize unlimited}} Seconds : 3
That is 25 seconds vs 3 seconds, a clear speed advantage using PowerShell remoting. And this is just in a relatively small test lab environment. Scale out to larger environments with a real world volume of message tracking logs to search through and you can see that a lot of time will be saved using remoting for multi-server message tracking log searches.
Pingback: наработки по message tracking-у | rusmandalay
Pingback: PowerShell – Exchange 2010/2013 MessageTrackingLog Examples 2 | BYTE Me Development
if you want to speed up you can use jobs
this will really speed up (i have a script that check in 10 hubs and the difference is amazing 1/10)
Can you please share your script with the -asjob . I’m having to do message tracking and the as jib command is not working properly for me.
Thanks
very interesting