Blog Summary
Just a quick blog detailing how to create a new SharePoint Web Application and Root Site with PowerShell.
The Script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#New Web App and Site Collection parameters $site = 'http://spwfe:99' $siteowner = "contoso\spfarm" $WebName = "Web App 99" $sitename = "Root Site" $sqldb = 'WSS_Content_99' $sqlsvr = 'sql' $SiteTemplate = "STS#3" $Language = 1033 $spaccount= (Get-SPManagedAccount $siteowner) $apppool = 'Web-99-AppPool' #Create the Web App $webapp = New-SPWebApplication -Name $WebName -URL $site -ApplicationPool $apppool -ApplicationPoolAccount $spaccount -DatabaseServer $sqlsvr -DatabaseName $sqldb Write-Host "Web Application was created, now creating the Root Site Collection" -ForegroundColor Green #Create the Root Site Collection New-SPSite -Url $site -OwnerAlias $siteowner -Template $SiteTemplate -Language $Language -ContentDatabase $sqldb |