ReplacementStrings -like $objItem.EdbFilePath} | select-object -first 1
Write-host ??? Mailbox store: ??? $objItem.Identity
Write-host ??? Last Defrag Completed: ??? $EventLogs.TimeGenerated
Write-host ??? ???
}
Figure 16-2
Part IV: Automating Administration
474
Notice in Figure 16 - 3 that if maintenance hasn ??™ t run within the period of time that the server has event
logs for, it shows up as a blank value for the last time the defrag was completed. In that case either
maintenance hasn ??™ t completed in a sufficient amount of time or the event log size is too small and should
be increased in size to keep more data.
Figure 16-3
This report would also be an excellent place to report when the last time a backup was run on each of the
stores. With the work you have already done to get this report it is a really easy task. In fact, the new
script would look like the following:
$servername = [System.Environment]::MachineName
$db = Get-StorageGroup -Server $servername | Get-MailboxDatabase -status
foreach ($objItem in $db)
{
$EventLogs = get-EventLog -LogName Application | Where-Object {$_.EventID -eq 703 -
or $_.EventID -eq 701 -and $_.Source -eq ???ESE??™ } | Where-Object {
$_.ReplacementStrings -like $objItem.EdbFilePath} | Select-Object -first 1
Write-Host ??? Mailbox store: ??? $objItem.
Pages:
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662