使用 Active Directory 回收站可以保留和还原意外删除的 Active Directory 对象。 启用 Active Directory 回收站时,将保留已删除的 Active Directory 对象的所有链接值和非链接值属性。 这意味着对象可以完全还原到它们在删除前所处的相同一致逻辑状态。 例如,还原的用户帐户会自动重新获得被删除前所具有的域中或跨域的所有组成员身份和相应的访问权限。
Important
默认情况下,Active Directory 回收站未启用。 启用 Active Directory 回收站的过程无法撤消。 在环境中启用 Active Directory 回收站之后,就无法再禁用。
Prerequisites
在启用 Active Directory 回收站之前,需要完成以下先决条件。
林和域功能级别必须为 Windows Server 2008 R2 或更高版本。
你必须是域中要启用 Active Directory 回收站的域管理员组的成员。
你必须安装以下任一远程服务器管理工具 (RSAT):
- Active Directory 管理中心 (ADAC)
- Windows PowerShell 的 Active Directory 模块。
启用 Active Directory 回收站
若要启用 Active Directory 回收站,请执行以下步骤:
以下介绍如何使用 Active Directory 管理中心 (ADAC) 启用 Active Directory 回收站:
登录到安装了适用于 Windows PowerShell 的 Active Directory 模块的计算机。
Open Active Directory Administrative Center, either from the Tools menu of the Server Manager console or by running an elevated PowerShell session and typing dsac.exe.
If the appropriate target domain isn't selected, choose Manage, choose Add Navigation Nodes, and select the appropriate target domain in the Add Navigation Nodes dialog box and then choose OK.
In the Tasks pane, choose Enable Recycle Bin in the Tasks pane, choose OK on the warning message box, and then choose OK to the refresh ADAC message.
若要刷新 ADAC,请按 F5 或选择刷新图标。
如果遇到错误,可以尝试将架构主机角色和域命名主机角色移至根域中的同一域控制器。 然后从该域控制器运行 cmdlet。
还原删除的对象
执行以下步骤,使用 Active Directory 管理中心还原已删除的对象。
Tip
只能还原启用 Active Directory 回收站后删除的 AD DS 项。 无法使用 Active Directory 回收站还原启用此功能之前删除的项目。
下面介绍如何使用 Active Directory 管理中心还原已删除的对象:
Open Active Directory Administrative Center, either from the Tools menu of the Server Manager console or by running an elevated PowerShell session and typing dsac.exe.
choose Manage, choose Add Navigation Nodes, and select the appropriate target domain in the Add Navigation Nodes dialog box and then choose OK.
Navigate to the Deleted Objects container.
Select the users you wish to restore and then choose either Restore in the Tasks pane, or Restore To in the Tasks pane and specify the location to which you wish to restore the deleted objects.
若要确认对象已还原到原始位置,请导航到目标域并确认用户帐户已列出。