Recipe5.5.Controlling Mailbox Size Limits


Recipe 5.5. Controlling Mailbox Size Limits

Problem

You want to apply mailbox size limits to users, groups, or organizational units, but Exchange only lets you set them on servers, mailbox databases, or the Exchange organization.

Solution

Using a graphical user interface

To set mailbox limits on an individual user, do the following:

  1. Log on to any machine in your domain that has the Exchange management tools installed.

  2. Open the ADUC snap-in (Users and Computers.msc).

  3. Locate the account whose mailbox limits you want to change.

  4. Right-click the target account or group and select Properties.

  5. The account properties dialog will appear. Switch to the Exchange General tab (remember, you'll only see this if you're editing a mail-enabled object and if you've installed ESM on the machine from which you're running the snap-in).

  6. Click the Storage Limits button; the Storage Limits dialog box will appear.

  7. Uncheck the Use mailbox store defaults button.

  8. Select the desired combination of warning, prohibit send, and prohibit send/receive limits and sizes.

  9. Click OK.

Using a command-line interface

To set a user's quota limits from the command line, use exchmbx with the -quota switch:

exchmbx -b <userDN> -quota <warningLimit>:<prohibitSendLimit>:<prohibitReceiveLimit>

You specify the quota limits in kilobytes, using ordinary integers (e.g., 100000:120000:125000 to specify limits of 100 MB, 120 MB, and 125 MB, respectively). To get mailbox send and receive limits for multiple users, you can use the csvde command to generate a CSV file listing the specified attribute values for all users. Here's an example:

 > csvde -f <fileName> -r <searchFilter> -l "DN, objectClass, name,  mDBSTorageQuota,mDBOverQuotaLimit,mDBOverHardQuotaLimit"

<fileName> is the name of the output CSV file; <searchFilter> is the search you want to use ("(&(objectClass=User)(objectCategory=Person))" will grab all mailboxes).

Using VBScript
' This code gets and sets mailbox quotas on the specified user ' ------ SCRIPT CONFIGURATION ------  strServerName = "<ServerName>"    ' e.g., CONT-EXBE01  strContainer= ", <container>, <ForestRootDN>"     ' e.g., ", CN=users,dc=robichaux,dc=net"  strUser= "<UserName>"         ' e.g., "Paul Robichaux"  ' ------ END CONFIGURATION --------- ' get the target mailbox Set objMailbox = GetObject("LDAP://" & strServerName & "/CN=" & _                            strUser & strContainer) ' get the warning limits; these gets will fail if ' the corresponding limit is not defined on error resume next warnLimit = objMailbox.Get ("mDBStorageQuota") prohibitSendLimit = objMailbox.Get ("mDBOverQuotaLimit") prohibitSendReceiveLimit = objMailbox.Get ("mDBOverHardQuotaLimit") ' display the limits, then bump each of them by 10 KB Wscript.echo "Existing quotas for " & strUser Wscript.echo "  warning limit:           " & warnLimit Wscript.echo "  prohibit send limit:     " & prohibitSendLimit Wscript.echo "  prohibit send/receive:   " & prohibitSendReceiveLimit objMailbox.Put "mDBStorageQuota", warnLimit+10 objMailbox.Put "mDBOverQuotaLimit", prohibitSendLimit+10 objMailbox.Put "mDBOverHardQuotaLimit", prohibitSendReceiveLimit+10 objMailbox.SetInfo WScript.Echo "Quotas for " & strUser & " updated."

Discussion

You can set mailbox storage limits in several different places, depending on how widely you want them to apply. By default, the storage limits you put on a mailbox (or public folder) database applies to the objects it contains; however, you can override those limits for individual mailboxes. As an optimization, only those limits that are actually set are stored. For example, let's say you've configured a database to provide a default set of limits of 200 MB for warning, 300 MB for prohibit send, and 325 MB for prohibit send/receive. You then edit a handful of mailboxes to apply new limits, unchecking Use mailbox store defaults and filling in your own values for the warning limit. If you then try to query the value of mDBOverQuotaLimit and mDBOverHardQuotaLimit on the mailbox, you'll find that these attributes don't exist; instead, you'll have to check the limits on the mailbox store to find out what the default limits are.

See Also

Recipe 4.5 for applying system policies to servers and Recipe 4.10 for setting default send/receive size limits on messages in transit



Exchange Server Cookbook
Exchange Server Cookbook: For Exchange Server 2003 and Exchange 2000 Server
ISBN: 0596007175
EAN: 2147483647
Year: 2006
Pages: 235

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net