Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How To Set Public Folder Storage Limit Properties


View products that this article applies to.

This article was previously published under Q294671

↑ Back to the top


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

↑ Back to the top


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.

↑ Back to the top


Keywords: KB294671, kbmsg, kbhowto

↑ Back to the top

Article Info
Article ID : 294671
Revision : 6
Created on : 2/22/2007
Published on : 2/22/2007
Exists online : False
Views : 291