Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Quota property
Collapse the table of content
Expand the table of content

SPSite.Quota property

Gets or sets a quota for the site collection.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public SPQuota Quota { get; set; }

Property value

Type: Microsoft.SharePoint.Administration.SPQuota
An SPQuota object that represents the quota.

The following code example uses the Quota property to apply a quota template to a site collection on the specified virtual server.

Uri uriNew = new Uri("http://Server_Name"); 
SPWebApplication oWebApp = SPWebApplication.Lookup(uriNew);

using(SPSite oSiteCollection = oWebApp.Sites["http://Site_Name"])
    oSiteCollection.Quota = SPWebService.ContentService.QuotaTemplates["Quota_Template_Name"]; 

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

© 2015 Microsoft