Tuesday, December 16, 2014

How to create subsite in powershell scripts?

Power Shell


Write-Output ""
Write-Output "How to dreating Subsites"

$SiteCollURL = "http://yoursite/"

$SiteCollTemplate = "SiteDefinitionTemplate#0"

$SiteCollLanguage = 1033

$SubSites = @("IT″, "Software")

for($i=0 ; $i -lt $SubSites.count ; $i++)
{
$SiteUrl = "”
$SiteUrl = $SiteCollURL + "/” 
$SiteUrl = $SiteUrl += $SubSites[$i]
Write-Output ” "
#Write-Output "create Site for ” += $SubSites[$i]
Write-Output ” "
New-SPWeb $SiteUrl -Template $SiteCollTemplate -Name 
"Your Site Name:"
$SubSites -UseParentTopNav -Language $SiteCollLanguage -Description
"Document Library description” $SubSites Write-Output ” " #Write-Output "Site Created for ” += $SubSites[$i] Write-Output ” " }


No comments:

Post a Comment