SharePoint 2010上面有很多的網站範本,讓管理者可以建置各種不同類型的網站,如果要透過程式碼API或是Windows PowerShell 來安装或建立網站的話,就必須知道網站的範本代號為何。
以下亞當斯整理一下來自MSDN上的Common site collection templates,網站樣板代碼表如下:
| Parameter value | Description | 描述 |
| GLOBAL#0 | Global template | 全域範本 |
| STS#0 | Team Site | 工作組網站 |
| STS#1 | Blank Site | 空白網站 |
| STS#2 | Document Workspace | 文件工作區 |
| MPS#0 | Basic Meeting Workspace | 基本會議工作區 |
| MPS#1 | Blank Meeting Workspace | 空白會議工作區 |
| MPS#2 | Decision Meeting Workspace | 決議會議工作區 |
| MPS#3 | Social Meeting Workspace | 社交會議工作區 |
| MPS#4 | Multipage Meeting Workspace | 多頁會議工作區 |
| CENTRALADMIN#0 | Central Admin Site | 管理中心網站 |
| WIKI#0 | Wiki Site | Wiki 網站 |
| BLOG#0 | Blog | 部落格 |
| SGS#0 | Group Work Site | 群組工作網站 |
| TENANTADMIN#0 | Tenant Admin Site | 租戶管理網站 |
| ACCSRV#0 | Access Services Site | Access Services 網站 |
| ACCSRV#1 | Assets Web Database | 資產 Web 資料庫 |
| ACCSRV#3 | Charitable Contributions Web Database | 慈善捐款 Web 資料庫 |
| ACCSRV#4 | Contacts Web Database | 連絡人 Web 資料庫 |
| ACCSRV#6 | Issues Web Database | 問題 Web 資料庫 |
| ACCSRV#5 | Projects Web Database | 專案 Web 資料庫 |
| BDR#0 | Document Center | 文件中心 |
| OFFILE#0 | (obsolete) Records Center | (已過時)記錄中心 |
| OFFILE#1 | Records Center | 記錄中心 |
| OSRV#0 | Shared Services Administration Site | 共用服務管理網站 |
| PPSMASite#0 | PerformancePoint | PerformancePoint |
| BICenterSite#0 | Business Intelligence Center | 商業智慧中心 |
| PWA#0 | Project Web App Site | Project Web App 網站 |
| PWS#0 | Microsoft Project Site | Microsoft Project 網站 |
| SPS#0 | SharePoint Portal Server Site | SharePoint Portal Server 網站 |
| SPSPERS#0 | SharePoint Portal Server Personal Space | SharePoint Portal Server 個人網站 |
| SPSMSITE#0 | Personalization Site | 個人化網站 |
| SPSTOC#0 | Contents area Template | 內容區域範本 |
| SPSTOPIC#0 | Topic area template | 主題區域範本 |
| SPSNEWS#0 | News Site | 新聞網站 |
| CMSPUBLISHING#0 | Publishing Site | 發佈網站 |
| BLANKINTERNET#0 | Publishing Site | 發佈網站 |
| BLANKINTERNET#1 | Press Releases Site | 新聞發佈網站 |
| BLANKINTERNET#2 | Publishing Site with Workflow | 使用工作流發佈網站 |
| SPSNHOME#0 | News Site | 新聞網站 |
| SPSSITES#0 | Site Directory | 網站目錄 |
| SPSCOMMU#0 | Community area template | 社區區域範本 |
| SPSREPORTCENTER#0 | Report Center | 報告中心 |
| SPSPORTAL#0 | Collaboration Portal | 協作門戶 |
| SRCHCEN#0 | Enterprise Search Center | 企業級搜索中心 |
| PROFILES#0 | Profiles | 設定檔 |
| BLANKINTERNETCONT | Publishing Portal | 發佈門戶 |
| SPSMSITEHOST#0 | My Site Host | “我的網站” HOST |
| ENTERWIKI#0 | Enterprise Wiki | 企業 Wiki |
| SRCHCENTERLITE#0 | Basic Search Center | 基本搜索中心 |
| SRCHCENTERLITE#1 | Basic Search Center | 基本搜索中心 |
| SRCHCENTERFAST#0 | FAST Search Center | 快速搜索中心 |
| visprus#0 | Visio Process Repository | Visio 流程儲存庫 |
以下是Windows PowerShell 透過網站範本建立網站的指令:
Set-ExecutionPolicy unrestricted -Force # answer Y
Add-PSSnapin Microsoft.SharePoint.Powershell
$SiteCollectionName = "Welcome to My Publishing Site"
$SiteCollectionURL = "http://www.contoso.com/sps/"
$ContentDatabase = "SP2010_ContentDB_Frontend"
$SiteCollectionTemplate = "BLANKINTERNET#1"
$SiteCollectionLanguage = 1033
$SiteCollectionDescription = "Publishing site"
$OwnerAlias = "DOMAIN\admin"
$OwnerEmail = "admin@contoso.com"
$SecondaryOwnerAlias = "DOMAIN\admin2"
$SecondaryEmail = "admin2@contoso.com"
# Create a new Sharepoint Site Collection
New-SPSite -Name $SiteCollectionName -URL $SiteCollectionURL -ContentDatabase $ContentDatabase Template $SiteCollectionTemplate -Language $SiteCollectionLanguage -Description $SiteCollectionDescription -OwnerAlias $OwnerAlias -OwnerEmail $OwnerEmail -SecondaryOwnerAlias $SecondaryOwnerAlias -SecondaryEmail $SecondaryEmail