Saturday, October 20, 2012

New Site And Templates Using Powershell

Add-PsSnapin Microsoft.SharePoint.Powershell –ErrorAction SilentlyContinue

 

      Write-Host  
      Write-Host  
      Write-Host "Creating New Site....  "  

 

 

$newSite = New-SPWeb -URL "http://globas:1030" -Template "STS#1" -Name "Home"


$siteURL = $newSite

$owner = “Administrator”

$secondOwner = “Administrator”

$template = “STS#1?

$description = “This is a sample site that was built using PowerShell.”

New-SPSite $siteURL -OwnerAlias $owner -SecondaryOwnerAlias $secondOwner -name “PowerShell for SharePoint” -Template $template -Description $description

No comments:

Post a Comment