We are planning to apply quotas on our site collections of about 60 which are already created in our web application . i thought of achieving that using power shell but we are facing a small problem which is in that 60 site collections i can keep quotas on only 40 site collections as the other 20 will grow rapidly everyday.The only way that i can see the difference is that the managed path of these site collections are different .can anyone please tell me how can i set the quota on a site collection only if it has a manged path 'projects'and leave those which have managed path called 'communities'
Thanks
My Code Up to now
function CreateQuotaTemplate ($Name, $MaxLevelMB, $WarnLevelMB)
{
$quotaTemplate = New-Object Microsoft.SharePoint.Administration.SPQuotaTemplate
$quotaTemplate.Name = $Name
$quotaTemplate.StorageMaximumLevel = ($MaxLevelMB*1024)*1024
$quotaTemplate.StorageWarningLevel = ($WarnLevelMB*1024)*1024
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService.QuotaTemplates.Add($quotaTemplate)
$contentService.Update()
}
CreateQuotaTemplate –Name “Power” –MaxLevelMB 300 –WarnLevelMB 280
# Replace all site collection quotas in a web application with a new template
$TemplateName = "Power"
$WebApplicationUrl = "http://myportal/"
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$quotaTemplate = $contentService.QuotaTemplates[$TemplateName]
$webApplication = Get-SPWebApplication $WebApplicationUrl
$webApplication.Sites | ForEach-Object { try { $_.Quota = $quotaTemplate; } finally { $_.Dispose(); } }