首页 > 代码库 > Powershell Exchange Message Per Day Sent and Reveive
Powershell Exchange Message Per Day Sent and Reveive
Powershell Exchange Message Per Day Sent and Reveive
# Initialize some variables used for counting and for outputGet-Date -UFormat "%Y-%m-%d-%H-%M" >>Per-day_recive.txt$Account="wendychen"[Int64] $intSent = $intRec = 0[Int64] $intSentSize = $intRecSize = 0[String] $strEmails = $null$times=Import-CSV "d:\LOGTime.csv"foreach ($time in $times) { # Start building the variable that will hold the information for the day $starttime=$time.starttime $endtime=$time.endtime echo $starttime $endtime ssss $intSent = $intRec = 0 (Get-TransportServer -Identity wendy-*) | Get-MessageTrackingLog -ResultSize Unlimited -Recipients "$Account" -Start "$starttime" -End "$endtime" | ForEach { # Sent E-mail If ($_.EventId -eq "RECEIVE" -and $_.Source -eq "STOREDRIVER") { $intSent++ $intSentSize += $_.TotalBytes } # Received E-mails If ($_.EventId -eq "DELIVER") { $intRec++ $intRecSize += $_.TotalBytes } } $intSentSize = [Math]::Round($intSentSize/1MB, 0) $intRecSize = [Math]::Round($intRecSize/1MB, 0)$DataBase = Get-Mailbox -Identity $Account |Get-MailboxStatistics Write-Host "$Account,`nintSentSize=$intSentSize,`nReciveSize=$intRecSize" -ForegroundColor Yellow $DataBase.DisplayName,$DataBase.DataBaseName,$starttime,$endtime,$intRecSize,$intSentSize -join ";">>d:\"$Account"-Per-day_recive.csv }
Powershell Exchange Message Per Day Sent and Reveive
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。