One of my peer departments is working on spamming the corporation. This internal spam, aka Corporate Newsletter, is to go out to everyone with a mailbox in the corporation. Unfortunately, a number of these people have abused their rights and their mailboxes are limited to receiving e-mail from only their managers.
In Exchange 5.5, you could create a simple CSV file and run the Admin tool to gather this information. Unfortunately, in Exchange 2003, mailbox settings are now integrated into Active Directory (AD). AD maintains all the mailbox information and settings, whereas the Exchange Admin tool is simply for server management (mail routing and global limits, etc.).
Then, how do you gather this information? I being the lazy, programmer-at-heart, that I am, wrote a VBScript to export the information. This worked great as I could set variables in the script to export the information I needed. This only worked for about a month, as I wanted pass this tool along to the internal employee for use (no way I was going to run this each time someone new was hired!!). That's why I put an HTA front-end on it!
To Use The Script
- Download attached ZIP and decompress to your hard drive.
- Modify the code to match your environment. Using Notepad without word-wrap turned on, will allow you to use CTRL+G to Go to specific line numbers.
- Line 321 - modify LDAP query for your environment. We have seperate OU's for each affiliate office. The dropdown includes an option for each OU.
<select onChange="" name=ClassesPulldown>
<option value="'LDAP://dc=corp,dc=ent'" >All OUs
<option value="'LDAP://ou=users,dc=corp,dc=ent'" >Users OU Only
</select> - Line 99 - Modify the
Select Casestatement to include each of the OU's.Select Case ClassesPulldown.Value
Case "LDAP://ou=users,dc=corp,dc=ent"
strExcelPath="Mailbox_Export_"&today&"_Users.xls"
Case else
strExcelPath="Mailbox_Export_"&today&"_All.xls"
End Select
- Line 321 - modify LDAP query for your environment. We have seperate OU's for each affiliate office. The dropdown includes an option for each OU.
- Make sure you have Excel installed on the local computer.
- Double-click HTA file and run. My export of the entire environment takes about 5-10 minutes for 3,500 mailboxes.
NOTE: We have set Custom Attribute 1 (aka ExtensionAttribute1) to a value (1, 2 or 3) for group or resource mailboxes. For example, the Postmaster mailbox has a value of 1,Conference rooms have a value of 2. Line 121 of the code is designed to filter on these values. Remove the line completely to get all mailboxes, or modify it for your environment.
Update August 16, 2007: I've modified the code to query the local AD for it's structure, so the above modifications are not necessary. After I made the changes, it started timing out when running the query, which shouldn't be related to the script changes. I suspect slowness in my AD.
| Attachment | Size |
|---|---|
| User Export Report.zip | 3.72 KB |
| User Export Report 2.zip | 4.7 KB |