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 = "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
- 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.