List of common templates:
$SiteName = "Human Resources Site"
$OwnerEmail = "USER_NAME@DOMAIN.com"
$OwnerAlias = "DOMAIN\USER_NAME"
$SiteURL = "http://intranet.DOMAIN.com/sites/hr"
$SiteTemplate = "STS#0"
Write-Host "Creating a relative site collection in the intranet web application"
New-SPSite -Url $SiteURL -owneralias $OwnerAlias -ownerEmail $OwnerEmail -Template $SiteTemplate
$Web = Get-SPWeb $SiteURL
$Web.title = $SiteName
$Web.update()
$WebAppURL = "http://intranet.DOMAIN.com"
$ContentDatabase = "Content_Intranet_BLOG"
Write-Host "Creating a new content database in the intranet web application"
New-SPContentDatabase $ContentDatabase -WebApplication $WebAppURL
$SiteName = "Intranet Blog"
$OwnerEmail = "USER_NAME@DOMAIN.com"
$OwnerAlias = "DOMAIN\USER_NAME"
$SiteURL = "http://intranet.DOMAIN.com/sites/blog"
$SiteTemplate = "BLOG#0"
Write-Host "Creating a relative site collection in the intranet web application with a separate content database"
New-SPSite -Url $SiteURL -owneralias $OwnerAlias -ownerEmail $OwnerEmail -ContentDatabase $ContentDatabase -Template $SiteTemplate
$Web = Get-SPWeb $SiteURL
$Web.title = $SiteName
$Web.update()
$SiteName = "Intranet WIKI"
$OwnerEmail = "USER_NAME@DOMAIN.com"
$OwnerAlias = "DOMAIN\USER_NAME"
$WebAppURL = "http://intranet.DOMAIN.com"
$SiteURL = "http://wiki.DOMAIN.com"
$SiteTemplate = "WIKI#0"
Write-Host "Creating a hostheader site collection in the intranet web application"
$WebApp = Get-SPWebApplication $WebAppURL
New-SPSite -url $SiteURL -HostHeaderWebApplication $WebApp -owneralias $OwnerAlias -ownerEmail $OwnerEmail -Template $SiteTemplate
$Web = Get-SPWeb $SiteURL
$Web.title = $SiteName
$Web.update()
$WebAppName = "Intranet Web Application"
$HostHeader = "wiki.DOMAIN.com"
Import-Module WebAdministration
New-WebBinding -Name $WebAppName -Port 80 -Protocol "http" -HostHeader $HostHeader
No comments:
Post a Comment