Tuesday, November 29, 2011

Create a Standard Quota

$quotaTemplateName = "Standard Quota"
$MaxLevelMB = 10240
$WarnLevelMB = 9216
    $quotaTemplate = New-Object Microsoft.SharePoint.Administration.SPQuotaTemplate
    $quotaTemplate.Name = $quotaTemplateName
    $quotaTemplate.StorageMaximumLevel = ($MaxLevelMB*1024)*1024
    $quotaTemplate.StorageWarningLevel = ($WarnLevelMB*1024)*1024
    $contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
    $contentService.QuotaTemplates.Add($quotaTemplate)
    $contentService.Update()