在 SharePoint Server 中还原 Secure Store Service 应用程序

适用于:yes-img-132013 yes-img-162016 yes-img-192019 yes-img-seSubscription Edition no-img-sopSharePoint in Microsoft 365

可以使用 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. 确认执行此过程的用户帐户是 Farm Administrators 组的成员。

  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. 在“从备份还原 - 第 2 步(共 3 步): 选择要还原的组件”页上,展开“共享服务应用程序”,并选中 Secure Store Service 应用程序备份组旁边的复选框,然后单击“下一步”

  6. 在“从备份还原 - 步骤 3(共 3 步:选择还原选项)”页上的“ 还原组件 ”部分中,确保 “服务器场\共享服务应用程序\<安全存储服务名称> ”显示在 “还原以下组件” 列表中。

    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. “刷新密钥 ”对话框中,在“ 通行短语 ”框中键入通行短语,然后单击“ 确定”。

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

可以使用 PowerShell 还原 Secure Store Service。

使用 PowerShell 还原 Secure Store Service 的具体步骤

  1. 确认您具有以下成员身份:

    • SQL Server 实例上的 securityadmin 固定服务器角色。

    • 要更新的所有数据库上的 db_owner 固定数据库角色。

    • 运行 PowerShell cmdlet 的服务器上的 Administrators 组。

    管理员可以使用 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> 是在其中备份服务应用程序的备份文件夹的路径。

    • <SecureStoreServicename> 是 Secure Store Service 应用程序的名称。

    如果有多个备份, BackupId 请使用 参数指定要使用的备份。 若要查看服务器场的所有备份,请在 PowerShell 命令提示符处键入以下命令:

    Get-SPBackupHistory -Directory <BackupFolder> -ShowBackup
    

    注意

    如果未为 BackupId 参数指定值,将使用最新的备份。 不能从仅配置备份还原 Secure Store Service。

  4. 成功完成还原操作后,必须刷新密码。 在 PowerShell 命令提示符处,键入以下命令:

    Update-SPSecureStoreApplicationServerKey -Passphrase <Passphrase>
    

    其中 <,通行短语是当前使用的通行短语>

如果在更新安全存储密码时发生错误,请参阅 刷新安全存储加密密钥

有关详细信息,请参阅 Restore-SPFarmUpdate-SPSecureStoreApplicationServerKey

注意

[!注意] 我们建议您在执行命令行管理任务时使用 Windows PowerShell。 Stsadm 命令行工具已被弃用,仍然包含该工具是为了支持与之前产品版本的兼容性。

另请参阅

概念

在 SharePoint Server 中备份 Secure Store Service