SCRIPT: Show mailbox limits

by Bharat Suneja

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)

{ 24 comments… read them below or add one }

Anonymous May 1, 2006 at 3:15 am

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?

Reply

Anonymous June 1, 2006 at 11:48 pm

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

But script works perfect and was helpful.

Reply

Anonymous July 31, 2006 at 1:46 am
Jamie August 3, 2006 at 9:45 am

Very helpful – works great! Thanks!

Reply

Hans August 25, 2006 at 1:04 am

See comment of Jamie!
Thanx

Reply

Anonymous September 20, 2006 at 7:28 am

great script – !!:)

Reply

Marcelo Moraes December 6, 2006 at 8:29 am

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

Thanks

Reply

Anonymous April 26, 2007 at 2:41 am

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.

Reply

Bharat Suneja April 28, 2007 at 7:48 am

Replace the following in line 43 under objCommand.CommandText:

“<” & strADPath & “>”

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

(distinguishedName of the OU)

Bharat

Reply

Anonymous May 24, 2007 at 5:45 am

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

Reply

Bharat Suneja May 24, 2007 at 9:02 am

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

Reply

Anonymous October 2, 2007 at 2:26 am

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)

Reply

Anonymous October 23, 2007 at 5:00 pm

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

Reply

Anonymous April 20, 2008 at 9:24 pm

How to show sending limit for each user

Reply

depikson June 3, 2008 at 11:54 am

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

Reply

Anonymous November 13, 2008 at 12:10 am

Thank ypu very much, indeed a time saver !

Reply

Anonymous November 18, 2008 at 3:32 pm

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

Reply

Anonymous June 23, 2009 at 3:33 am

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?

Reply

Bharat Suneja December 22, 2009 at 5:08 pm

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

Reply

Anonymous January 7, 2010 at 11:49 am

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

Reply

Chris Toledo March 9, 2010 at 10:20 am

Great Script…Thanks!

Reply

Anonymous March 17, 2010 at 9:21 am

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

Reply

Bharat Suneja March 17, 2010 at 9:32 am

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

Reply

J Leeds April 9, 2010 at 12:01 pm

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

Reply

Leave a Comment

Previous post:

Next post: