powershell 这将使用模板在SharePoint中创建子站点。请注意,在创建网站后应用模板
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 这将使用模板在SharePoint中创建子站点。请注意,在创建网站后应用模板相关的知识,希望对你有一定的参考价值。
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()
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://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)
以上是关于powershell 这将使用模板在SharePoint中创建子站点。请注意,在创建网站后应用模板的主要内容,如果未能解决你的问题,请参考以下文章
powershell 这将获取SharePoint网站中用于创建网站的模板
powershell 这将使用PowerShell从库中删除SharePoint中特定文件夹和子文件夹中的文件
powershell 这将编译SharePoint搜索服务应用程序中的搜索范围。我在创建新示波器时使用了这个。
powershell 这将获取SharePoint中使用InfoPath的所有实例。图书馆和名单