In Prove the worth of
your Exchange server, you read about the importance of making sure that you
and senior management were always aware of the critical nature of your Exchange
infrastructure, and you read about various tools that help you to gather
various statistics about your Exchange servers. Unfortunately, many Exchange
monitoring tools can cost a lot of money–often too much to be able to easily
justify.
Never fear. With a little elbow grease, you can write Visual
Basic Script code that can help you to gather important statistics about your Exchange
mailbox stores. Suppose, for example, that you want to be able to watch the
growth of your Exchange stores in a very granular way so that you can take
action where appropriate. You might have a user hogging 6 GB of space on your
Exchange server, for instance. Or, you might want to be able to watch storage
trends so that you can anticipate what your storage needs will be for an
upcoming budget request. Regardless, gathering this kind of information isn’t
hard!
The VB Script code below accomplishes this, plus a little
more. It uses WMI (Windows Management Instrumentation) to gather various
statistics about each mailbox in your Exchange store, including the mailbox
name, the total size (in KB), the number of items it contains, and its status.
The status is really useful if you’ve imposed mailbox limits on users and you
want to run a report that shows who has mailboxes in the warning stage, or who
is unable to send mail as a result of going over their quota. There are five
possible status values:
1: Below Limit
2: Issue Warning
4: Prohibit Send
8: No Checking
16: Mailbox Disabled
The code in Listing A will do the trick! You can then open
the CSV file in Excel and manipulate it to your needs.