EX2007 Queue monitoring
Here is the same Queue monitoring script, but then written for exchange 2007.
##
# Exchange queue monitoring for exchange 2007
# Written by Marcel Stangenberger
#
# Created on 27/10/2009
# Version 1.0
##$queuecount = (get-queue | where {$_.MessageCount -gt “20″})
$queueview = (get-queue)
$messageview = (get-queue | where {$_.MessageCount -gt “20″} | get-message)
$redalert = “red ” + (get-date)
$greenalert = “green ” + (get-date)
$tmppath = “C:\Program Files (x86)\Quest Software\Big Brother\BBNT\tmp\queue”
$logpath = “C:\Program Files (x86)\Quest Software\Big Brother\BBNT\Logs\queue”if ( test-path $tmppath )
{
remove-item $tmppath
}if ( $queuecount -eq $null )
{
$greenalert | out-file -encoding ASCII $tmppath
$queueview | out-file -encoding ASCII $tmppath -append
$messageview | out-file -encoding ASCII $tmppath -append
}
Else
{
$redalert | out-file -encoding ASCII $tmppath
$queueview | out-file -encoding ASCII $tmppath -append
$messageview | out-file -encoding ASCII $tmppath -append
}if ( test-path $logpath )
{
remove-item $logpath
}move-item $tmppath $logpath