Share via


Setting Mailbox Storage Limits

Setting Mailbox Storage Limits

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

A common store policy is to limit the amount of disk space allocated for each mailbox. The IMailboxStore::StoreQuota property specifies the maximum size of the mailbox, in kilobytes. After the user reaches this limit, a warning message appears every time he or she sends a message. If the amount of disk space that the user consumes is not important, retain this property's default value of –1.

If you do set StoreQuota, you might also set the IMailboxStore::OverQuotaLimit property. This property specifies the number of kilobytes over the StoreQuota limit that the user can go before he or she is restricted from sending mail. This is a gentle reminder to the user to clear some space in his or her mailbox.

Finally, set the IMailboxStore::HardLimit property to the number of kilobytes over the StoreQuota limit that the user can go before he or she is restricted from sending or receiving mail. This is a final notice to the user to clear some space in his or her mailbox.

Example

This example limits jamessmith to 10 MB, with a 2-MB soft limit and an additional 1-MB hard limit. He gets 13 MB before losing mail privileges.

Visual Basic

Sub Set_Limits(recipname As String, _
               DomainName As String)

    'DomainName is something like "DC=MYDOMAIN3,DC=example,DC=com"
    'recipname is something like "jamessmith"

    Dim objPerson As New CDO.Person
    Dim objMailbox As CDOEXM.IMailboxStore

    objPerson.DataSource.Open "LDAP://CN=" + recipname + _
                                ",CN=users," + DomainName

    Set objMailbox = objPerson
    If objMailbox.HomeMDB = "" Then
       MsgBox "No Mailbox found."
    Else
       objMailbox.EnableStoreDefaults = False
       objMailbox.StoreQuota = 10
       objMailbox.OverQuotaLimit = 12
       objMailbox.HardLimit = 13
       objPerson.DataSource.Save
       MsgBox "Mailbox limits for " + recipname + " set successfully"
    End If

End Sub

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.