Monitoring transaction logs
In environments that do not use Circular Logging for their mailbox databases, an issue with Exchange backups can cause the number of transaction logs to keep increasing. If the issue persists for several days, databases might start running out of disk space. As such, it is crucial to keep an eye on the number of transaction logs not yet committed for each database.
In this recipe, you will see how to use the Shell to check and monitor the number of transaction logs across all Exchange servers in the environment.
How to do it...
To monitor the number of transaction logs in the environment and alert if these go above a set limit for any database, use the following code:
[Array] $DBcol = @() [Bool] $alert = $False [Int] $logThreshold = 3000 Get-MailboxDatabase -Status | Where {$_.Mounted} | ForEach { $DBobj = New-Object PSObject -Property @{ Name = $_.Name Path = $_.LogFolderPath Server = ($_.MountedOnServer).Split(".")...