切换到宽版
  • 5197阅读
  • 0回复

[求助]使用脚本跟踪Exchange 2007的具体信息 [复制链接]

上一主题 下一主题
 
只看楼主 倒序阅读 0楼  发表于: 2011-03-20
— 本帖被 YOYO 从 Exchange 脚本中心 移动到本区(2015-06-25) —
  • 脚本环境:PowerShell
  • 适合版本:Exchange 2007
  • 适用平台:
如果你正在寻找具体的信息,并有许多不同的Exchange2007服务器,无论是集线器或邮箱服务器,这个脚本可以帮助你!

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

分享到
快速回复
限60 字节
 
上一个 下一个