Question

I am pretty new to Sharepoint, but I am wondering if there is a way to get the maximum allocated space for a Sharepoint Site Collection, Site, and Recycle Bin?

I know to get the size of a Site Collection you could use nameOfSPSite.Usage.Storage to get the size of site collection, but I am looking for a way to get the maximum storage capacity, so I can show users how close their Site Collection, Site, or Recycle Bin are to their limits. I need to also do this programaticly in C#.

Thanks

Était-ce utile?

La solution

You want to know the nameOfSPSite.Quota

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.quota.aspx

Edit: the Storage property contains the Recycle Bin usage in it, to specifically get the size from the Recycle Bin you need to sum the items in it, something like:

var rbTotal = SPContext.Current.Site.RecycleBin.OfType<SPRecycleBinItem>().Sum(rbi => rbi.Size)
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top