ConvertTo-MessageLatency
param(
[Microsoft.Exchange.Management.TransportLogSearchTasks.MessageTrackingEvent] $MessageTrackingEvent
)
begin
{
# PrintLatencies
function PrintLatencies
{
param(
[Microsoft.Exchange.Management.TransportLogSearchTasks.MessageTrackingEvent] $mte = $(throw "argument is mandatory")
)
# Get latency objects from the event.
$latencies = [Microsoft.Exchange.Management.TransportLogSearchTasks.MessageTrackingLatency]::GetLatencies($mte)
# Print each latency component.
foreach ($latency in $latencies)
{
$latency
}
}
# Print usage information
function Usage
{
@"
NAME
ConvertTo-MessageLatency
SYNOPSIS
ConvertTo-MessageLatency -MessageTrackingEvent MessageTrackingEvent
SHORT DESCRIPTION
The ConvertTo-MessageLatency command gets retrieves component latency details from a message tracking event.
DETAILED DESCRIPTION
Parameters:
-MessageTrackingEvent MessageTrackingEvent
[Microsoft.Exchange.Management.TransportLogSearchTasks.MessageTrackingEvent]
[pipeline input allowed]
A message tracking log event object.
---
ConvertTo-MessageLatency reads the MessageInfo, MessageLatency, and LatencyType properties
from the MessageTrackingEvent object specified and writes a collection of MessageTrackingLatency objects to the pipeline.
This command also supports the ubiquitous parameters:
-Debug (-db), -ErrorAction (-ea), -ErrorVariable (-ev), -WarningAction (-wa), -WarningVariable (-wv),
-OutputBuffer (-ob), -OutputVariable (-ov), and -Verbose (-vb)
NOTES
TBD
EXAMPLES
Get-MessageTrackingLog | ConvertTo-MessageLatency
Output: a collection of MessageTrackingLatency objects that will contain combination of message-specific properties and component latencies
Get-MessageTrackingLog -EventId:扴END?-Start:'5/4/2007 2:09:20 PM' -End:'5/4/2007 3:09:20 PM' | where {$_.MessageLatency.TotalSeconds -gt 90} | ConvertTo-MessageLatency | where {$_.ComponentCode -eq 慟D?-and $_.ComponentLatency.TotalSeconds -gt 30} | fl MessageId,ServerIp,MessageLatency,ComponentLatency
"@
}
}
process
{
# process pipelined tracking events.
if ($_ -ne $null)
{
PrintLatencies $_
}
}
end
{
# check for Usage Statement request
if (($args.Count -gt 0) -and ($args[0] -imatch "-{1,2}[?h]"))
{
# user wants the usage statement
Usage
return
}
# if a tracking event was passed in as an argument, process it.
if ($MessageTrackingEvent -ne $null)
{
PrintLatencies $MessageTrackingEvent
}
}
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23700676/viewspace-1052337/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23700676/viewspace-1052337/