使用脚本可以搜索邮箱服务器应用日志并报告出可用数据库的空间。
$result="Database"+"`t"+"Whitespace (MB)"+"`n"
$date=get-date -format "M/d/yyyy"
$server = get-mailboxserver
foreach ($i in $server){
$pslog = new-object System.Diagnostics.EventLog("Application", "$i")
$colevents= $pslog.Entries | where-object { ($_.EventID -like "1221") - AND ($_.TimeGenerated -like "$date*")}
foreach ($j in $colevents) {$result+= $j.replacementstrings[1]
+"`t"+$j.replacementstrings[0]+"`n"}
}
$result > c:\temp\test.xls