Submitted By: Christian Ruppert

Searches mailbox server application logs and reports available database space.

PowerShell
Edit|Remove
$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