It’s Monday morning, the caffeine from your morning coffee still hasn’t hit you yet, and like clockwork %USERNAME% calls with password issues…typical.
So if you don’t know about it or are looking for something, PRTG is a great and powerful network monitoring tool. I’d recommend checking it out. There’s a free trial and you can start getting details of your network in just a few short minutes thanks to their super easy setup and configuration. Now I’m not going to review PRTG because I’m sure there’s plenty of reviews already out there, but simply put they have built-in monitors/sensors that are preconfigured for what you want to monitor. Should these built-in sensors not be adequate, they have the custom external sensor. Basically, this custom sensor allows you to use your own application or script to return text or XML data back to PRTG to log and report on. That’s what this is about. A script that will monitor Exchange 2010’s transport queue and output the results to XML and set a warning based on the total count of emails in the queue. You can setup your own alerting of this sensor to email you when the “queue fills up”.
I had a need to monitor a file/directory for changes, or more specifically entries into an error log by an application. I wanted a trigger on file change using a PowerShell or some other script, since the application didn’t have alerting capabilities built in. I wanted a script to check read the log file and send an email when the file changes containing what was changed, or in this case what the error was. You can tweak the script to monitor a directory or specific file, and customize the email with the file name or more. Either way this is the basic script. Schedule a task in Task Scheduler (Windows 7) or Scheduled Tasks (Windows XP) to run at login for that specific user, and make sure it never terminates or times out. Set your application to run:
I wanted some transparency into the transport queue on Exchange 2010 mail servers to check or identify potential email failures or delays. Most of the time these are emails that were sent to “no-reply” addresses or typos in the recipient’s email address.
I spent part of the day yesterday looking for a good way to dump members/users of a Distribution group. No big deal except this situation has many levels of nested groups. There’s a Quest (Dell) PowerShell snapin that will do this, but why install anything else on a production server that doesn’t need to be there? I did, however, find an article for Exchange 2007 that did something like this, but when using it for 2010 it didn’t work for my needs. I just needed something simple that would work with Exchange 2010 and would run “out of box” on the server… Here’s what I came up with: