How To Set Public Folder Storage Limit Properties (294671)



The information in this article applies to:

  • Microsoft Exchange 2000 Server
  • ActiveX Data Objects (ADO) 2.5
  • Microsoft Visual Basic Professional Edition for Windows 6.0

This article was previously published under Q294671

SUMMARY

This article provides sample Visual Basic code that demonstrates how to create a public folder and set its storage limit properties from a client computer by using Internet Publishing Provider (Msdaipp.dso).

MORE INFORMATION

Public folder storage limit properties such as Issue Warning Limit, Prohibit Post Limit, and Maximum Item Size cannot be set using the normal Hypertext Transfer Protocol (HTTP) Uniform Resource Locator (URL) of a public folder. The administrator can set these properties by using a HTTP URL that resembles the following:

http://servername/exadmin/admin/domainname/public folders/yourfolder

To run the sample code, follow these steps:
  1. In Visual Basic, create a new Standard EXE project.
  2. Reference the Microsoft ActiveX Data Objects 2.5 Library.
  3. Paste the following code in a Visual Basic module.
    Private Sub Main()
        Dim cn As ADODB.Connection
        Dim rec As ADODB.Record
        Dim strConn As String
        Dim strURL As String
        'TO DO:Change the servername to reflect your Exchange Server.
        strConn = "http://servername/public/"
        ' You need to use the admin account and 
        ' admin name space to set public folder property.
        'TO DO:Change strURL below to reflect your public folder 
        ' whose limits you are setting.
        strURL = "http://servername/exadmin/admin/"
        strURL = strURL + "domainname"
        strURL = strURL + "/public folders/storagetest/"
    
        Set cn = CreateObject("ADODB.Connection")
        Set rec = CreateObject("ADODB.Record")
        cn.Provider = "msdaipp.dso"
    
        'TO DO:Change the line below to reflect your 
        ' Administrator Account and password.
        cn.Open strConn, "domain\administrator", "password"
        
        rec.Open strURL, , adModeReadWrite, adCreateCollection Or _ 
           adCreateOverwrite
    
        ' Set folder content class to Calendar.
        rec.Fields("DAV:contentclass") = "urn:content-classes:calendarfolder"
        ' Set outlookfolderclass.
        rec.Fields _
           ("http://schemas.microsoft.com/exchange/outlookfolderclass") = _ 
           "IPF.Appointment"
        'Use the quotas specified by other properties.
            rec.Fields _
          ("http://schemas.microsoft.com/mapi/proptag/0x67790003").Value = 1
        'Issue warning at (Kb).
        rec.Fields("http://schemas.microsoft.com/exchange/storagequotaissuewarninglimit").Value = 200
        'Prohibit post at (Kb).
        rec.Fields("http://schemas.microsoft.com/mapi/proptag/0x67210003").Value = 210
        'Maximum item size (Kb).
        rec.Fields("http://schemas.microsoft.com/mapi/proptag/0x67220003").Value = 50
        rec.Fields.Update
        
        rec.Close
        cn.Close
        
        Set rec = Nothing
        Set cn = Nothing
    End Sub
    					
  4. In the code, replace servername and domainname to reflect your Exchange environment, and change the administrator's username and password accordingly.
  5. Compile and run the code. The public folder is created and the properties are set.

Modification Type:MinorLast Reviewed:7/13/2004
Keywords:kbhowto kbMsg KB294671