跟踪 Exchange 2007 日志

如果你正在寻找特定的消息,有许多不同的 Exchange 2007 服务器,此脚本可以帮助你!
PowerShell
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$strRecipient = Read-Host “Enter part or recipient e-mail address like *toto* ”
#$strSender = Read-Host “Enter part or sender e-mail address”
#$strSubject = Read-Host “Enter part of the subject”
$strStart = Read-Host “Enter start date DD-MM-YY”
$strEnd = Read-Host “Enter end date DD-MM-YY (the day after to include a specific day) ”

write-host “Please wait”
write-host “Please wait.”
write-host “Please wait..”
write-host “Please wait…”
write-host “Please wait….”
write-host “Please wait…..”
write-host “Search will depend on the number of logs that are viewed…”

Get-ExchangeServer | where {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-MessageTrackingLog -ResultSize Unlimited -EventID “RECEIVE” -Start $strStart -End $strEnd | where {$_.recipients -like “$strRecipient”} | Select-Object Timestamp,ServerHostname,ClientHostname,Source,EventId,Sender,@{Name=”Recipients”;Expression={$_.recipients}},MessageSubject | Sort-Object -Property Timestamp | export-csv “C:\temp\trackingresults.csv”

write-host “The file C:\TEMP\trackingresults.csv has been created.”

start-sleep 5

Latest posts by Exchange中文站 (see all)
发布于: 浏览:1843 次

还没有评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据