Quota templates and Blocked file types...

Jul 23, 2012 at 3:06 PM

Has anyone added quota templates and blocked file types to the autospinstaller script? If so would you mind sharing your code? I am looking into another script I got from M$ that has this but I will need to rewrite it for autospinstaller. I will post if once I get it complete if no one else posts...



Jul 24, 2012 at 8:40 AM
Edited Jul 24, 2012 at 8:42 AM

did some quota template stuff in my last project. Here's the xml part (I put inside the FARM section

   <QuotaTemplate name="MySite" MaxStorageMB="10" WarningStorageMB="8" SandBoxMaxPoints="0" SandBoxWarningPoints="0"/>
   <QuotaTemplate name="Small" MaxStorageMB="2048" WarningStorageMB="1600" SandBoxMaxPoints="100" SandBoxWarningPoints="80"/>
   <QuotaTemplate name="Large" MaxStorageMB="102400" WarningStorageMB="80000" SandBoxMaxPoints="300" SandBoxWarningPoints="240"/>

and here's the code:

# ===================================================================================
# Func: CreateQuotaTemplates
# Desc: Create Basic Quota Templates
# ===================================================================================
Function CreateQuotaTemplates ([xml]$xmlinput)
	If ($xmlinput.Configuration.Farm.QuotaTemplates)
		Write-Host -ForegroundColor White " - Creating Quota Templates..."
		ForEach ($Template in $xmlinput.Configuration.Farm.QuotaTemplates.QuotaTemplate)
				$quotaTemplate = New-Object Microsoft.SharePoint.Administration.SPQuotaTemplate
				$quotaTemplate.Name = $Template.Name
				$max =  [System.Decimal]::Parse($Template.MaxStorageMB)*1024*1024
				$quotaTemplate.StorageMaximumLevel = $max
				$warning =  [System.Decimal]::Parse($Template.WarningStorageMB)*1024*1024
				$quotaTemplate.StorageWarningLevel = $warning
				$quotaTemplate.UserCodeMaximumLevel = $Template.SandBoxMaxPoints
				$quotaTemplate.UserCodeWarningLevel = $Template.SandBoxWarningPoints
				$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
				Write-Output $_
				Throw " - Error provisioning the state service application"

got nothing for blocked filetypes but this should be easy.