SCRIPT: Show mailbox limits

At times the user’s mailbox limits are adjusted to bypass the limits set on a store or all stores by a policy. This is done by unchecking 1) “Use mailbox store defaults” in user’s properties –> Exchange General –> Storage Limits.

New values can be added for 2) “Issue warning at (KB):”, 3) “Prohibit send at (KB):”, and 4) “Prohibit send and receive at (KB):” fields.

The corresponding attributes in AD are:

  1. mDBUseDefaults
  2. mDBStorageQuota
  3. mDBOverQuotaLimit
  4. mDBHardQuotaLimit

Unchecking number 1 and not adding any values to 2, 3 & 4 result in user having a mailbox with no limits.

Here’s a script that lists all mailboxes that have their limits changed to bypass store defaults (mDBUseDefaults=FALSE), and lists the 3 attributes above if present.

Usage:

showMailboxLimits.vbs /f:outputfilename.txt

adding a /s:y suppresses console output

Output produced is comma separated, can be opened in a spreadsheet.

Update:
1/17/2007: New script that shows mailbox quotas for all users, including those applied by the Store and any System Policies that may be applied to the Store:
SCRIPT: Show mailbox quotas (including Store & Policy quotas)

Written by

Bharat Suneja

0 Comments

  1. Anonymous

    Need to create a script for work that lists the mailbox enabled users on an Exchange 2003 server – and also lists the mailbox storage limit, domain name and DLs that each user is a member of – I can do some of this with a WMI script but cannot do the whole of it. Can someone help?

  2. Anonymous

    KB to MB conversion should be /1024, not /1000 ;)

    But script works perfect and was helpful.

  3. Jamie

    Very helpful – works great! Thanks!

  4. Hans

    See comment of Jamie!
    Thanx

  5. Anonymous

    great script – !!:)

  6. Marcelo Moraes

    Very Good, I’d made a change to enable you to generate the list by server and it’s working well

    Thanks

  7. Anonymous

    hello, how i can change the script to view the mailbox limits from a special OU under the rootDSE. Thanks for your Answer.
    Lg, Mario.

  8. Bharat Suneja

    Replace the following in line 43 under objCommand.CommandText:

    “<” & strADPath & “>”

    with:
    “<LDAP://OU=YourOU,DC=Domain,DC=Com>”

    (distinguishedName of the OU)

    Bharat

  9. Anonymous

    Script is giving output of 1000 IDs only. How to get the output of all users in AD

  10. Bharat Suneja

    This is the default behaviour of an ADODB query to ADSI. This can be modified by inserting the following:
    objCommand.Properties(“Page Size”) = 20000

    (*note, the above value of 20,000 can be changed to a value appropriate for your environment)

    after the following statement:
    objCommand.ActiveConnection = objConnection

    so it looks like:
    objCommand.ActiveConnection = objConnection
    objCommand.Properties(“Page Size”) = 20000

  11. Anonymous

    What a terrific piece of work!

    Can anyone tell me if I can refine it to show the particular store the output’d users are in? I’m using a great many stores and it’d be grand to see this broken down per store.

    Thanks :o)

  12. Anonymous

    Thanks very much for this script, did in 10 seconds what I would potentially have to click through each user to find out!

    There’s always a better way :)

  13. Anonymous

    How to show sending limit for each user

  14. depikson

    This was a giant time saver. Thanks so much for this slick script!!!

  15. Anonymous

    Thank ypu very much, indeed a time saver !

  16. Anonymous

    Bharat Thank you for this. Too many non-admins before did not understand what they were doing by not limiting users. Now the difficult part is to get people used to limiting usage. Top 10 users = 25GB

  17. Anonymous

    is it possible to modify this script in such a way that it will prompt for a user name (maybe alias) then it will show the user's default limit and the current mailbox limit settings?

  18. Bharat Suneja

    @Anonymous from Dec. 22: Thanks for catching that – fixed.

  19. Anonymous

    The script worked perfect on Exchange 2007 – thank you for saving me tons of time.

  20. Anonymous

    How about adding in each user mailbox storage actually used?
    Rich

  21. Bharat Suneja

    @Rich: That'd require a trip to the Store and make it a lot slower. There are plenty of scripts available that do that (look up Glen Scales' blog). This script simply gets data from AD.

    When you move to Exchange 2007/2010, this is very easily taken care of by Exchange Shell.

  22. J Leeds

    Very nice script, and very useful. The "No Stop Send" and "No Stop Receive" are backwards, though. (Lines 75 and 82 in the script.)

    J

Leave a Comment

Your email address will not be published. Required fields are marked *