Script – Check Message Queue
Here is a simple script I wrote that checks the message queue and then sends an email if the message queue goes over a specified limit. — Start of Script — function check_queue { $a = get-transportserver | get-queue | measure-object MessageCount -max if ($a.Maximum -gt 25) { send_email $a.Maximum Exit } start-sleep -s 60 ...