Backup-SPConfigurationDatabase

執行伺服器陣列層級的僅限設定備份。

Syntax

Backup-SPConfigurationDatabase
      -Directory <String>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-DatabaseCredentials <PSCredential>]
      [-DatabaseName <String>]
      [-DatabaseServer <String>]
      [-Item <String>]
      [<CommonParameters>]
Backup-SPConfigurationDatabase
      [-AssignmentCollection <SPAssignmentCollection>]
      [-DatabaseCredentials <PSCredential>]
      [-DatabaseName <String>]
      [-DatabaseServer <String>]
      [-Item <String>]
      [-ShowTree]
      [<CommonParameters>]

Description

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set, and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet parameter sets.

Backup-SPConfigurationDatabase Cmdlet 會執行目前伺服陣列的僅限設定備份,或執行未附加至目前伺服器陣列之個別設定資料庫的僅限設定備份。 如果您想要執行目前伺服器陣列的僅限設定備份,則不需要指定 DatabaseServer 和 DatabaseName 參數。 不過,針對這類案例,建議使用 Backup-SPFarm Cmdlet 搭配 ConfigurationOnly 參數。

設定備份一例為:管理員建立的伺服器陣列設定範本,之後只要使用 Restore-SPFarm Cmdlet 執行還原,即可套用至其他的 SharePoint 伺服器陣列。

如需 SharePoint 產品Windows PowerShell的許可權和最新資訊,請參閱 線上檔: https://go.microsoft.com/fwlink/p/?LinkId=251831

範例

-------------------範例 1--------------------

Backup-SPConfigurationDatabase -DatabaseName SharePoint_Config -DatabaseServer SqlServer1 -Directory \\server\share\Backup -ShowTree

此範例會顯示可納入僅限設定備份的元件。

-------------------範例 2--------------------

Backup-SPConfigurationDatabase -DatabaseName SharePoint_Config -DatabaseServer SqlServer1 -Directory \\server\share\Backup -Verbose

此範例會執行僅限設定備份,並顯示詳細資訊輸出。

參數

-AssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseCredentials

指定對應至 SQL Server 資料庫管理員使用者名稱的識別碼及密碼。

This parameter should only be specified if SQL authentication is used to connect to the database. If Windows authentication is used to connect to the database, then this parameter should not be specified.

Type:PSCredential
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseName

指定設定資料庫名稱。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseServer

指定包含設定資料庫的 SQL 資料庫伺服器。 預設值為本機電腦名稱。

此類型必須是有效的資料庫伺服器,例如 DS。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Directory

指定 SharePoint 產品儲存其所產生備份套件的路徑。 如果您有安裝SQL Server的電腦和 SharePoint 產品的實例,您可以使用本機磁片磁碟機路徑。 這包括了基本安裝。 不過,如果SQL Server和 SharePoint 產品安裝在多部電腦上,或您有多部執行 SharePoint 產品的伺服器,您必須使用通用命名慣例 (UNC) 共用路徑,以便將SQL Server資料庫和搜尋元件寫入相同的位置;例如 \ \ ,computer_name\volume\Backup) 。

Multiple backup packages can be stored in the same location. This is the same path that you pass to the Directory parameter of the Restore-SPFarm cmdlet.

此類型必須是下列其中一個有效路徑:

  • C:\folder_name
  • \\server_name\folder_name

會自動建立 spbr* 資料夾。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Item

Indicates the part of the farm to back up. You may use the full farm path notation as displayed by the ShowTree parameter or the name of the target component in the path if the component has a unique name. If multiple items match the name, the full path must be provided. Surround the item or path in quotation marks if it contains a space.

如果未指定 Item 參數,將備份整個伺服器陣列設定。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-ShowTree

根據傳送到 backup cmdlet 的其他參數 (即 Item 參數),顯示伺服器陣列中要備份的物件。 根據傳送到 Backup-SPConfigurationDatabase cmdlet 的其他參數,要在備份中排除的項目前面會有星號字元 (*)。 無法備份的專案會以方括弧括住 ([ ]) 。 若有 ShowTree 參數,即不執行備份。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition