在 SharePoint Server 中還原Secure Store Service 應用程式

 

**適用版本:**SharePoint Server 2013, SharePoint Server 2016

**上次修改主題的時間:**2017-09-13

**摘要:**了解如何在 SharePoint Server 2016 和 SharePoint Server 2013 中還原 Secure Store Service 應用程式。

您可以使用 SharePoint 管理中心網站或 PowerShell 來還原 Secure Store Service 應用程式。所使用的還原工具會視已部署的環境類型、排程需求以及與組織建立的服務等級協定而定。

本文內容:

  • 開始之前

  • 在 SharePoint 中使用管理中心還原 Secure Store Service

  • 在 SharePoint 中使用 Windows PowerShell 還原 Secure Store Service

開始之前

Secure Store Service 提供安全儲存認證集的功能,以及將認證與特定身分識別或一組身分識別建立關聯的功能。

開始這項作業之前,請先檢閱下列 Secure Store Service 應用程式的相關資訊:

  • 每次您輸入新的複雜密碼時,SharePoint Server 都會建立新的主要金鑰,然後使用該金鑰重新加密認證集。複雜密碼可讓您存取 SharePoint Server 所建立的主要金鑰,以用於加密認證集。

  • 還原 Secure Store Service 時將需要在備份 Secure Store Service 時記錄的複雜密碼。

在 SharePoint Server 中使用 管理中心 還原 Secure Store Service

使用下列程序可透過管理中心還原 Secure Store Service。

使用 管理中心 還原 Secure Store Service

  1. 確認執行此程序的使用者帳戶為伺服器陣列管理員群組的成員。

  2. 啟動管理中心。

  3. 在管理中心首頁上,按一下 [備份與還原] 區段中的 [從備份還原]。

  4. 在 [從備份還原 - 步驟 3 之 1:選取要還原的備份] 頁面上,從備份清單中選取包含所需備份的備份工作,或選取伺服器陣列層級備份,然後按 [下一步]。只要按一下備份旁的 (+),即可檢視每項備份的詳細資訊。

    注意

    若正確的備份工作未出現,請在 [備份目錄位置] 文字方塊中,輸入正確的備份資料夾路徑,然後按一下 [重新整理]。
    您無法從僅有設定的備份,還原 Secure Store Service。

  5. 在 [從備份還原 - 步驟 3 之 2:選取要還原的元件] 頁面上,展開 [共用服務應用程式],然後選取 Secure Store Service 應用程式備份群組旁的核取方塊,再按 [下一步]。

  6. 在 [從備份還原 - 步驟 3 之 3:選取還原選項] 頁面上,確定 [還原元件] 區段中的 [Farm\Shared Services\Shared Services Applications\<Secure Store Service 名稱>] 出現在 [還原下列元件] 清單中。

    在 [還原選項] 區段的 [還原的類型] 下,選取 [相同的設定] 選項。對話方塊會隨即出現,請您確認該作業。按一下 [確定]。

    按一下 [開始還原]。

  7. 您可以在 [備份與還原工作狀態] 頁面上方的 [整備] 區段中,檢視所有復原工作的一般狀態。在同頁面底部的 [還原] 區段中,則可檢視目前復原工作的狀態。狀態頁面每 30 秒會自動更新。只要按一下 [重新整理],即可手動更新狀態詳細資料。備份與復原都是計時器服務工作。因此,復原要數秒後才會開始。

    若收到任何錯誤,您可在 [備份與還原工作狀態] 頁面的 [失敗訊息] 欄中加以檢閱。也可在步驟 3 中所指定之路徑下的 Sprestore.log 檔案中,找到詳細資料。

  8. 成功完成還原作業後,必須重新整理複雜密碼。

  9. 在管理中心首頁上,按一下 [應用程式管理] 區段中的 [管理服務應用程式]。

  10. 在 [服務應用程式] 頁面上,按一下 Secure Store Service 名稱。您可能會收到「無法取得主要金鑰」的錯誤。

  11. 在 [Secure Store Service] 頁面上,按一下功能區上的 [重新整理金鑰]。

  12. 在 [重新整理金鑰] 對話方塊中的 [複雜密碼] 方塊內輸入複雜密碼,然後按一下 [確定]。

在 SharePoint Server 中使用 PowerShell 還原 Secure Store Service

您可以使用 PowerShell 還原 Secure Store Service。

使用 PowerShell 還原 Secure Store Service

  1. 確認您具備下列成員資格:

    • SQL Server 執行個體上的 securityadmin 固定伺服器角色。

    • 所有要更新之資料庫上的 db_owner 固定資料庫角色。

    • 正在執行 PowerShell Cmdlet 之所在伺服器上的系統管理員群組。

    系統管理員可以使用 Add-SPShellAdmin Cmdlet 授與使用 SharePoint Server Cmdlet 的權限。

    注意

    如果您不具備上述權限,請連絡安裝程式系統管理員或 SQL Server 系統管理員要求權限。如需 PowerShell 權限的其他資訊,請參閱 Add-SPShellAdmin

  2. 啟動 SharePoint 管理命令介面。

  3. 在 PowerShell 命令提示字元處,輸入下列命令:

    Restore-SPFarm -Directory <BackupFolder> -Item <SecureStoreServicename> -RecoveryMethod Overwrite [-BackupId <GUID>] [-Verbose]
    

    其中:

    • <BackupFolder> 是備份服務應用程式的備份資料夾路徑。

    • <Secure Store Service 名稱> 是 Secure Store Service 應用程式的名稱。

    如果您具有多個備份,請利用 BackupId 參數指定要使用的備份。若要檢視伺服器陣列的所有備份,請在 PowerShell 命令提示字元處輸入下列命令:

    Get-SPBackupHistory -Directory <BackupFolder> -ShowBackup
    

    注意

    如果未指定 BackupId 參數的值,則會使用最近的備份。您無法從僅有設定的備份,還原 Secure Store Service。

  4. 成功完成還原作業後,必須重新整理複雜密碼。在 PowerShell 命令提示字元處輸入下列命令:

    Update-SPSecureStoreApplicationServerKey -Passphrase <Passphrase>
    

    其中 <複雜密碼> 是您目前使用的複雜密碼。

如需詳細資訊,請參閱<Restore-SPFarm>和<Update-SPSecureStoreApplicationServerKey>。

注意

建議您在執行命令列管理工作時使用 Windows PowerShell。Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。

See also

在 SharePoint Server 中備份 Secure Store Service