magritton
8/1/2014 - 8:17 PM

This creates a sub site in SharePoint using a template. Note the template is applied after the site is created

This creates a sub site in SharePoint using a template. Note the template is applied after the site is created

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
$web = get-spweb http://portal.opwftg.com/sites/OPWSS
$template = $web.GetAvailableWebTemplates(1033) | Where-Object {$_.Name -eq '{6A973B06-4483-4320-93D3-6F4A60EDC854}#Master Safety Site Template'}
#$template = $web.GetAvailableWebTemplates(1033) | Where-Object {$_.Title -eq 'OPW Safety - Cells'}
$newWeb = New-SPWeb -Url 'http://portal.opwftg.com/sites/OPWSS/Teams/Safety/siteTest3' -Name 'site Test3'
$newWeb.ApplyWebTemplate($template)
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
$web = get-spweb http://scushp01/sites/Testing
$template = $web.GetAvailableWebTemplates(1033) | Where-Object {$_.Name -eq 'STS#2'}
$newWeb = New-SPWeb -Url 'http://scushp01/sites/Testing/IT/Main' -Name 'Main'
$newWeb.ApplyWebTemplate($template)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$web = Get-SPWeb http://scushp01/Teams
write-host “Web Template:” $web.WebTemplate ” | Web Template ID:” $web.WebTemplateId
$template = $web.WebTemplate

$web = get-spweb http://scushp01/teams
$newWeb = New-SPWeb -Url 'http://scushp01/Teams/2013release' -Name "2013release"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "2013 Epysis Release Testing"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/AllStaff' -Name "AllStaff"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "2015 All Staff Meeting"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/MBSVISA' -Name "MBSVISA"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Business VISA"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/compliance' -Name compliance
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Compliance"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/DarigoldMerger' -Name "DarigoldMerger"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Darigold Merger"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/docusignAdoption' -Name "docusignAdoption"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "DocuSign Adoption Team"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/ERM' -Name "ERM"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "ERM"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/eServices' -Name "eServices"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "eServices"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/Imagecenter' -Name "Imagecenter"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "ImageCenter/EPS Project"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/IntranetCommittee' -Name "IntranetCommittee"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Intranet Committee"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/MBS' -Name "MBS"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Member Business Services"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/mlink' -Name "mlink"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Meridian Link Opening Act Installation"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/openingact' -Name "openingact"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "ML Opening Act"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/p2p' -Name "p2p"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "P2P"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/PortOfSeattleMerger' -Name "PortOfSeattleMerger"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "POS FCU Merger"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/Release2014' -Name "Release2014"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Release 2014.00"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/Release201401' -Name "Release201401"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Release 2014.01"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/statements' -Name "statements"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Statements"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/synergy' -Name "synergy"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Synergy"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/tpt' -Name "tpt"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "test project tracker"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/Verafin' -Name "Verafin"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "Verafin"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/VISAProcessorChange' -Name "VISAProcessorChange"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "VISA Processor Change"

$newWeb = New-SPWeb -Url 'http://scushp01/Teams/WS2015' -Name "WS2015"
$newWeb.ApplyWebTemplate($template)
Get-SPWeb 'http://scushp01/Teams/2013release' | Set-SPWeb -Title "West Seattle Project"

$web.Dispose()