使用PowerShell 建立SharePoint 網站

來源:互聯網
上載者:User

標籤:sharepoint   2010   powershell   網站   

使用PowerShell 建立SharePoint 網站        在SharePoint開發中,你應該學會使用PowerShell管理SharePoint網站。SharePoint Management Shell是一個Windows PowerShell模組,你可以用它高效管理SharePoint 使用者、網站、網站集合和組織。        這裡教你簡單的語句,建立一個SharePoint網站。        輸入一下語句。紅色框內資訊是按下Enter後出現的。
        建立的網站如下:
        首先我們需要理解如何使用PowerShell建立網站。new-spweb這一特殊命令只有一個必要元素,即網站的URL,但是也有許多其他參數,在建立網站時使用可以豐富網站資訊。-url:新建立網站的URL。-template: 添加模板號。-name: 顯示網站名稱。-AddToTopNav: 是否要網站顯示在頂部導覽列。-UseParentTopNav:是否要網站使用父網站的導航。        經測試,支援漢字網站名稱。        關於SharePoint 2010 網站模板名稱與ID的對應,請查看http://blogs.msdn.com/b/richin/archive/2011/07/04/sharepoint-2010-site-template-names.aspx        如果你不確定哪些模板是可用的,你可以使用Get-SPWebTemplate返回可用模板的列表。
補充建立新的Web應用程式New-SPWebApplication -Name <name>-HostHeader <hostheader> Port <port>  -Url<url> -ApplicationPool <application pool> -ApplicationPoolAccount <applicationpoolaccount> –DataBaseName <databasename>
                                                           ------------------------------------分割線----------------------------------------New-SPWebApplication -Name “Company Intranet” -HostHeader “intranet.company.com”-Port 80 -Url “http://intranet.company.com:80” -ApplicationPool “SharePoint Web Applications” -ApplicationPoolAccount (Get-SPManagedAccount “CompanySP_Service”)  -DatabaseName “WSS_Content_Intranet”
刪除Web應用程式Remove-SPWebApplication http://intranet.company.com -DeleteIISSite -RemoveContentDatabase -Confirm:$false
建立內容資料庫New-SPContentDatabase -Name<ContentDBName> -WebApplication <WebApplicationName>
                                                           ------------------------------------分割線----------------------------------------
New-SPContentDatabase -Name WSS_Content_Intranet_Sales -WebApplication http://intranet.company.com
建立網站集合New-SPSite -URL “<URL for the new site collection>” -Name <name>  -ContentDatabase <content database name> -OwnerAlias “<domainuser>” -Template <template>
                                                           ------------------------------------分割線----------------------------------------
New-SPSite -URL “http://intranet.company.com/sites/sales” -Name “Sales” -ContentDatabase  WSS_Content_Intranet_Sales -OwnerAlias “COMPANYSPAdmin” -Template “STS#0″        以上也不是什麼新的知識,在其他地方你也可以看到。我這裡總結一下,只是為了以後需要的時候,能夠很快地引用它們。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.