SCRIPT: Show mailbox quotas (including Store & Policy quotas)

by Bharat Suneja

I had earlier posted a script that lists users’ mailbox limits/quotas [read previous post “SCRIPT: Show mailbox limits“]. That script only picks up users who have their mailbox limits set individually, bypassing the “normal” users who have their mailbox storage limits set by the Store or a System Policy.

Here’s another one on those lines – this script lists mailbox storage limits for *all users*, even if set by the Store or a System Policy. In case it is set by the Store, it displays the quota set by the Store. If a System Policy is applied to the Store (on which the mailbox resides) to enforce mailbox storage limits, it displays limits enforced by the Policy.

The script can output results to a file – use the /f:

checkmailboxquotas.vbs /f:c:\docs\Quotas.txt

You can also compress console output (the actual mailbox limit data – run-time info will still be output to the console. This shows which Store it is connecting to, et al.. ).

It was a little harder to code than it appears from the description above. :) Want to know more about the things I tried? Read previous post “Conflicting Mailbox Store Policies“)

If for some reason it doesn’t work for you, please post the issue in comments for this post.

Disclaimer: View all downloaded code/scripts with suspicion, including mine. Try them in a test environment first. I (or whoever posts such scripts on the web) could just as easily include code that deletes all your recipients and other AD objects :). These scripts do not come with any warranties or support, nor confer any rights.

Thank you for your script on mailbox quotas! I’m not a great scripter at all, but I made a couple of adjustments to fit in my own environment and it worked very well. In part anyway..

I’d like to extend it to child domains. We have a relatively complex environment, where the Exchange servers are all part of a root domain, with the majority of users, but have some user accounts in child domains. (Without getting into details, think politics as the reason…) I have been unable to get the script modified in such a way as to drill down into a child domain for the user account portion. I’m not a great scripter,as I mentioned, but I assume that the second, user section is where I need to make changes. Do you have any ideas?

Also, because of our naming conventions, we have multiple message stores with identical names, so I couldn’t use the CN value when populating the dictionary results, but had to use the full DN to get uniqueness. Not a biggie, but thought I would mention it.

And finally, I used your script in conjunction with another to fulfill a request by my supervisor for a list of all mail accounts, size, last logon, and quota values. Unfortunately, the two scripts are enough different and produce output differently, that combining the results meant a lot of manual cleanup and merging spreadsheets. Do you have any ideas on how to script this all together? It seems like such a simple request from my supervisor, until you start figuring out all the places that information is being stored…

When I originally created these scripts, getting objects from one Domain was all I needed. If you have more than one domain, and the attribute(s) are replicated to a Global Catalog (part of partial replica), you can simply modify the LDAP search strings to start with GC://.

If you need to go after attributes not replicated to GCs, you will need to do some referral chasing. This is described and illustrated here:http://snipr.com/1nkp8

Look at listing 5.32: The first line stores the value &h20; for the variable ADS_CHASE_REFERRALS_SUBORDINATE (a string, that we can later use more conveniently than its value, though I personally prefer shorter strings). Later in the script, look at the line:objCommand.Properties(“Chase Referrals”) = ADS_CHASE_REFERRALS_SUBORDINATE

Common sense dictates referral chasing is more expensive than getting all the data from one source, either a single DC or GC.

I thought about including the mailbox size in this script but didn’t have the time (or the need back then) to add it.

I’ve increasingly less time for creating new scripts, and I suspect something similar may already exist out there. If not, sounds like a fun Sunday afternoon project that won’t happen this summer, if ever. :)

I tried your script but didn;t work on my envi. I have error message ” table doesn’t exist, line 48, char 8″FYI, last time, I used your previous script “showmailboxlimits.vbs” and it’s okay. But it didn’t show me the all user mailbox/storage limit including the default setting.

I get the same result as the previous poster. Here is my complete output:———————————–C:\>cscript showmailboxquotas.vbs /f:C:\Quotas.txtMicrosoft (R) Windows Script Host Version 5.6Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

As a side note, I tried the other script as well (showMailboxLimits.vbs) It run fine, but it gave no results: “No users with individual mailbox limits found!” (there are plenty of users with individual limits set.)

I think that the problem here is that I run the script from a server in a subdomain to to the enterprise root domain (even though the output shows the name of the child domain). Because when I run both scripts in another environment with only a single domain it works well.

So, how exactly can I modify the script so that it only runs for objects in my child domain?

Is there a way for mailbox quotas set for individual mailboxes to revert back to use mailbox store quotas in Exchange 2007.

We migrated from exhange 2003 to exchange 07 with higher mailbox quotas and some of the 03 users had custom mailbox quotas, we now have a bigger mailbox in 07 and want all users of 07 to use the default exchange 2007 mailbox store quotas.pls advice