It’s always a good idea to keep control of how many mailboxes you have in Microsoft Exchange. Why? There are several types of objects in Exchange that have mailbox-like behaviors, so they can receive mail from the outside world. This includes:
- Distribution lists
- Contacts (similar to forwarding addresses)
- Public folders that have an email address associated with it
- And user mailboxes
Spam filtering appliances and hosted filtering services charge you per mailbox. So it’s a good idea for you to keep tabs on what can receive mail from the outside world and thus keep your costs under control. As soon as any of these objects receive an external email (either from a spammer or from a user sending from outside your network), this will inevitably add another seat to filter.
Reducing your security footprint is another reason for minimizing the number of mailboxes. I created a tool called listboxes.vbs to find old / dead boxes and delete them. By cleaning up the system, you will have fewer mailboxes for spammers to target and fill up your Exchange mail store for no reason.
This tool was written using a simple VB script that uses an LDAP query to enumerate all the mailbox-like objects in Active Directory. It goes recursively through the entire AD tree and dumps any object with a ‘proxyaddress’ attribute (used by Exchange). It also gives you the total number of mailbox-like objects.
You can download it from here: http://support.vircom.com/supteam/listboxes.vbs
To use it:
From the command line, enter
cscript listboxes.vbs ‘<ip-of-DC>’ ‘389’ ‘Base DN’ ‘User’ ‘somepass’ >result.txt
Example
cscript listboxes.vbs ‘10.10.10.10’ ‘389’ ‘DC=topdomain,DC=local’ ‘user@topdomain.local‘ ‘somepass’ >result.txt
The account you use can be a normal user (i.e., not an Administrator account), as long as it has Read access to the whole tree. This should give you a good output file to work with.
Enjoy!
Leave a Comment