在 SharePoint Server 中建立網站集合Create a site collection in SharePoint Server

摘要: 如何在現有 Web 應用程式中建立 SharePoint Server 2016 或 SharePoint 2013 網站集合。Summary: How to create a SharePoint Server 2016 or SharePoint 2013 site collection in an existing web application.

網站集合是一般頂層網站之下一組具有相同擁有人並共用管理設定 (例如權限) 的網站。當您建立網站集合時,網站集合中會自動建立頂層網站。接著您可以在頂層網站下建立一個或多個子網站。A site collection is a grouping of websites under a common top-level site that have the same owner and share administration settings, for example, permissions. When you create a site collection, a top-level site is automatically created in the site collection. You can then create one or more subsites below the top-level site.

開始之前Before you begin

在建立網站集合之前,請確定符合下列必要條件:Before you create a site collection, ensure that the following prerequisites are available:

  • 要建立網站集合的 Web 應用程式。A web application in which to create the site collection.

  • 配額範本,用於預計要定義值以指定可在網站集合中儲存的資料量,以及觸發電子郵件通知給網站集合管理員的儲存大小。如需詳細資訊,請參閱<在 SharePoint Server 中建立、編輯和刪除配額範本>。A quota template, if you plan to define values that specify how much data can be stored in a site collection and the storage size that triggers an email alert to the site collection administrator. For more information, see Create, edit, and delete quota templates in SharePoint Server.

  • 自訂之受管理的萬用字元路徑,用於預計在根 (/) 目錄或 /sites/ 目錄以外的位置建立網站集合。如需詳細資訊,請參閱<在 SharePoint Server 中定義受管理的路徑>。A custom managed wildcard path, if you plan to create the site collection somewhere other than under the root (/) directory or the /sites/ directory. For more information, see Define managed paths in SharePoint Server.

使用管理中心建立網站集合Create a site collection by using Central Administration

SharePoint 管理中心網站一般用於建立獨立部署中的網站集合。You typically use the SharePoint Central Administration website to create a site collection in a stand-alone deployment.

使用管理中心建立網站集合To create a site collection by using Central Administration

  1. 確認是否具備下列系統管理認證:Verify that you have the following administrative credentials:

    • 您必須是執行 SharePoint 管理中心 網站之電腦上的 SharePoint 伺服器陣列管理員群組成員,才可建立網站集合。To create a site collection, you must be a member of the Farm Administrators SharePoint group on the computer that is running the SharePoint Central Administration website.
  2. 開啟 管理中心。Open Central Administration.

  3. 在管理中心網站上,按一下 [應用程式管理]**** 區段中的 [建立網站集合]*On Central Administration, in the *Application Management section, click Create site collections.

  4. 在 [建立網站集合]**** 頁面的 [Web 應用程式]**** 區段中,若尚未選取要建立網站集合的 Web 應用程式,請在 [Web 應用程式]**** 功能表上,按一下 [變更 Web 應用程式]*,然後按一下要建立網站集合的 Web 應用程式。On the *Create Site Collection page, in the Web Application section, if the web application in which you want to create the site collection is not selected, on the Web Application menu, click Change Web Application, and then click the web application in which you want to create the site collection.

  5. 在 [標題與描述]**** 區段中,輸入網站集合的標題及描述。In the Title and Description section, type the title and description for the site collection.

  6. 在 [網站位址]**** 區段中,選取 URL 使用的路徑,例如包含相對路徑的路徑 (如 /sites/) 或根目錄 (/)。 In the Web Site Address section, select the path to use for your URL (for example, a wildcard inclusion path such as /sites/, or the root directory (/).

    若選取包含相對路徑,也必須在網站的 URL 中輸入要使用的網站名稱。If you select a wildcard inclusion path, you must also type the site name to use in your site's URL.

  7. 在 [範本選擇]**** 區段的 [選取範本]**** 清單中,選擇您要讓網站集合使用的索引標籤 (共同作業企業發佈),然後選取要用於網站集合之頂層網站的範本。您也可以按一下 [自訂]**** 索引標籤,來建立空白網站並於稍後套用範本。In the Template Selection section, in the Select a template list, choose the tab you want for the site collection (Collaboration, Enterprise, or Publishing), and then select the template that you want to use for the top-level site in the site collection. You can also click the Custom tab to create an empty site and apply a template later.

    所選取範本的描述會顯示在範本清單下方。A description for the template that you select appears below the list of templates.

  8. 在 [主要網站集合管理員]**** 區段中,輸入將擔任網站集合管理員之使用者的使用者名稱 (格式為「網域\使用者名稱」)。In the Primary Site Collection Administrator section, type the user name (in the form DOMAIN\username) for the user who will be the site collection administrator.

  9. 在 [次要網站集合管理員]**** 區段中,輸入網站集合次要管理員的使用者名稱。In the Secondary Site Collection Administrator section, type the user name for the secondary administrator of the site collection.

    指派次要的網站集合管理員是確保當主要網站集合管理員沒空時,有人可管理網站集合的最佳作法。Assigning a secondary site collection administrator is a best practice to ensure that someone can manage the site collection when a primary site collection administrator is not available.

  10. 若使用配額管理網站集合的儲存,請在 [配額範本] 區段中,按一下 [選取配額範本] 清單中的範本。If you are using quotas to manage storage for site collections, in the Quota Template section, click a template in the Select a quota template list.

  11. 按一下 [確定]*Click *OK.

使用 Microsoft PowerShell 建立網站集合Create a site collection by using Microsoft PowerShell

希望自動化工作時,一般會使用 Microsoft PowerShell 建立網站集合,這在企業中很常見。You typically use Microsoft PowerShell to create a site collection when you want to automate the task, which is common in enterprises.

藉由使用 PowerShell 建立網站集合To create a site collection by using PowerShell

  1. 確認您具備下列成員身分:Verify that you have the following memberships:

    • SQL Server 執行個體上的 securityadmin 固定伺服器角色。securityadmin fixed server role on the SQL Server instance.

    • 所有要更新之資料庫上的 db_owner 固定資料庫角色。db_owner fixed database role on all databases that are to be updated.

    • 正在執行 PowerShell Cmdlet 之所在伺服器上的本機系統管理員群組。local Administrators group on the server on which you are running the PowerShell cmdlets.

  2. 開啟 SharePoint 管理命令介面。Open the SharePoint Management Shell.

  3. 從 Microsoft PowerShell 命令提示字元中輸入下列命令,然後按 ENTER 鍵:From the Microsoft PowerShell command prompt, type the following commands, and then press ENTER:

    Get-SPWebTemplate
    
    $template = Get-SPWebTemplate "STS#0"
    
    New-SPSite -Url "<URL for the new site collection>" -OwnerAlias "<domain\user>" -Template $template
    

    此範例會擷取所有可用網站範本的清單,然後使用 [小組網站] 範本建立網站集合。如需詳細資訊,請參閱<New-SPSite>與<Get-SPWebTemplate>。This example retrieves a list of all available site templates and then creates a site collection by using the Team Site template. For more information, see New-SPSite and Get-SPWebTemplate.

    建議您在執行命令列管理工作時使用 Windows PowerShell。Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。We recommend that you use Microsoft PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

另請參閱See also

概念Concepts

在 SharePoint Server 中管理網站集合Manage site collections in SharePoint Server