跟踪 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

Exchange中文站

Exchange中文站

Exchange中文站是一个专注讨论 Microsoft Exchange Server / Exchange Online / Office 365 的技术型网站。
Exchange中文站

Exchange中文站 的最新文章 (查看所有)

发布于: 浏览:373 次

还没有评论

欢迎参与到我们的技术讨论,问题和分享都可以。