Microsoft KB Archive/294671

= How To Set Public Folder Storage Limit Properties =

Article ID: 294671

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft Exchange 2000 Server Standard Edition
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft Visual Basic 6.0 Professional Edition

-



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:

 In Visual Basic, create a new Standard EXE project. Reference the Microsoft ActiveX Data Objects 2.5 Library.  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 = &quot;http://servername/public/&quot; ' 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 = &quot;http://servername/exadmin/admin/&quot; strURL = strURL + &quot;domainname&quot; strURL = strURL + &quot;/public folders/storagetest/&quot;

Set cn = CreateObject(&quot;ADODB.Connection&quot;) Set rec = CreateObject(&quot;ADODB.Record&quot;) cn.Provider = &quot;msdaipp.dso&quot;

'TO DO:Change the line below to reflect your ' Administrator Account and password. cn.Open strConn, &quot;domain\administrator&quot;, &quot;password&quot; rec.Open strURL,, adModeReadWrite, adCreateCollection Or _ adCreateOverwrite

' Set folder content class to Calendar. rec.Fields(&quot;DAV:contentclass&quot;) = &quot;urn:content-classes:calendarfolder&quot; ' Set outlookfolderclass. rec.Fields _ (&quot;http://schemas.microsoft.com/exchange/outlookfolderclass&quot;) = _ &quot;IPF.Appointment&quot; 'Use the quotas specified by other properties. rec.Fields _ (&quot;http://schemas.microsoft.com/mapi/proptag/0x67790003&quot;).Value = 1 'Issue warning at (Kb). rec.Fields(&quot;http://schemas.microsoft.com/exchange/storagequotaissuewarninglimit&quot;).Value = 200 'Prohibit post at (Kb). rec.Fields(&quot;http://schemas.microsoft.com/mapi/proptag/0x67210003&quot;).Value = 210 'Maximum item size (Kb). rec.Fields(&quot;http://schemas.microsoft.com/mapi/proptag/0x67220003&quot;).Value = 50 rec.Fields.Update rec.Close cn.Close Set rec = Nothing Set cn = Nothing End Sub  In the code, replace servername and domainname to reflect your Exchange environment, and change the administrator's username and password accordingly. Compile and run the code. The public folder is created and the properties are set.

Keywords: kbhowto kbmsg KB294671

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.