Share via


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

適用于:yes-img-132013 yes-img-16 2016yes-img-192019 yes-img-se訂閱版本 no-img-sopMicrosoft 365 中的 SharePoint

您可以使用 SharePoint 管理中心網站或 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. On the Restore from Backup — Step 1 of 3: Select Backup to Restore page, select the backup job that contains the backup that you want, or a farm-level backup, from the list of backups, and then click Next. You can view more details about each backup by clicking the (+) next to the backup.

    注意事項

    If the correct backup job does not appear, in the Backup Directory Location text box, type the path of the correct backup folder, and then click Refresh. You cannot use a configuration-only backup to restore the Secure Store Service.

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

  6. 在 [從備份還原 - 步驟 3: 選取還原選項] 頁面的 [還原元件] 區段中,確定 [還原元件] 清單中會顯示 [伺服器陣列\共用服務\共用服務\共用服務應用程式\ < Secure Store 服務名稱 >]。

    In the Restore Options section, under Type of restore, select the Same configuration option. 隨即會出現一個對話方塊,要求您確認作業。 按一下 [確定]

    按一下 [開始還原]。

  7. You can view the general status of all recovery jobs at the top of the Backup and Restore Job Status page in the Readiness section. You can view the status for the current recovery job in the lower part of the page in the Restore section. The status page updates every 30 seconds automatically. You can manually update the status details by clicking Refresh. Backup and recovery are Timer service jobs. Therefore, it may take a several seconds for the recovery to start.

    If you receive any errors, you can review them in the Failure Message column of the Backup and Restore Job Status page. You can also find more details in the Sprestore.log file at the path that you specified in step 3.

  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>
    

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

如果更新 Secure Store 複雜密碼時發生錯誤,請參閱 重新整理 Secure Store 加密金鑰

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

注意事項

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

另請參閱

概念

在 SharePoint Server 中備份 Secure Store Service