• 1. London, UK
  • 2. New York, NY
  • 3. Sydney, Australia
  • 4. Melbourne, Australia
  • 5. Moscow, Russia
  • 6. Singapore
  • 7. Paris, France
  • 8. Chicago, IL
  • 9. Hong Kong
  • 10. Houston, TX

Wednesday, October 26, 2005


SCRIPT: Show mailbox limits

Posted by Bharat Suneja at 1:41 AM
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.


showMailboxLimits.vbs /f:outputfilename.txt

adding a /s:y suppresses console output

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

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)"

Labels: ,


May 1, 2006 3:15 AM
Anonymous Anonymous said...

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?

June 1, 2006 11:48 PM
Anonymous Anonymous said...

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

But script works perfect and was helpful.

July 31, 2006 1:46 AM
Anonymous Anonymous said...

http://www.suneja.com/blog/stuff/showmailboxlimits.zip is not accessible anymore...

August 3, 2006 9:45 AM
Anonymous Jamie said...

Very helpful - works great! Thanks!

August 25, 2006 1:04 AM
Anonymous Hans said...

See comment of Jamie!

September 20, 2006 7:28 AM
Anonymous Anonymous said...

great script - !!:)

December 6, 2006 8:29 AM
Anonymous Marcelo Moraes said...

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


April 26, 2007 2:41 AM
Anonymous Anonymous said...

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.

April 28, 2007 7:48 AM
Blogger Bharat Suneja said...

Replace the following in line 43 under objCommand.CommandText:

"<" & strADPath & ">"


(distinguishedName of the OU)


May 24, 2007 5:45 AM
Anonymous Anonymous said...

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

May 24, 2007 9:02 AM
Blogger Bharat Suneja said...

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

October 2, 2007 2:26 AM
Anonymous Anonymous said...

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)

October 23, 2007 5:00 PM
Anonymous Anonymous said...

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 :)

April 20, 2008 9:24 PM
Anonymous Anonymous said...

How to show sending limit for each user

June 3, 2008 11:54 AM
Blogger depikson said...

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

November 13, 2008 12:10 AM
Anonymous Anonymous said...

Thank ypu very much, indeed a time saver !

November 18, 2008 3:32 PM
Anonymous Anonymous said...

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

June 23, 2009 3:33 AM
Anonymous Anonymous said...

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?

December 22, 2009 5:08 PM
Blogger Bharat Suneja said...

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

January 7, 2010 11:49 AM
Anonymous Anonymous said...

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

March 9, 2010 10:20 AM
Anonymous Chris Toledo said...

Great Script...Thanks!

March 17, 2010 9:21 AM
Anonymous Anonymous said...

How about adding in each user mailbox storage actually used?

March 17, 2010 9:32 AM
Blogger Bharat Suneja said...

@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.

April 9, 2010 12:01 PM
Blogger J Leeds said...

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



Post a Comment

Links to this post:

Create a Link

<< Home