且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows Server 2008 R2之活动目录回收站

更新时间:2022-09-17 08:18:16

一、先决条件
更新活动目录架构
1、在架构操作主控(schema master operations master)角色的DC运行adprep /forestprep
2、在基础架构主控 infrastructure operations master 角色的DC上运行adprep /domainprep /gpprep
一般来说,活动目录的五种角色会放在一台DC上,可以通过命令netdom query fsmo查看角色情况,还可以在通过活动目录用户和计算机、活动目录域和信任管理控制台查看
Windows Server 2008 R2之活动目录回收站Windows Server 2008 R2之活动目录回收站Windows Server 2008 R2之活动目录回收站Windows Server 2008 R2之活动目录回收站Windows Server 2008 R2之活动目录回收站
3、在只读域控制器(RODC)上运行adprep /rodcprep
4、确保域中所有的DC安装Windows Server 2008 R2
 
二、提升活动目录功能级别
活动目录回收站中Windows Server 2008 R2功能级别所具有的新特性之一,所以须将森林级别提升为Windows Server 2008 R2。
提升方法有以下几种
1、活动目录域和信任管理控制台
Windows Server 2008 R2之活动目录回收站Windows Server 2008 R2之活动目录回收站
2、活动目录管理中心(DSAC.exe)
Windows Server 2008 R2之活动目录回收站
3、通过ADSIedit.msc进行编辑
运行ADSIedit.msc,连接到配置分区,操作如下图。修改msDS-Behavior-Version值为4
Windows Server 2008 R2之活动目录回收站
活动目录级别目前有四种Windows 2000 native,windows server 2003,windows server 2008,windows server 2008 R2,msDS-Behavior-Version值的属性分别1、2、3、4;
4、使用Set-ADForestMode cmdlet修改
运行管理工具中的Active Directory Module for Windows PowerShell,然后输入
Set-ADForestMode –Identity hbycrsj.com -ForestMode Windows2008R2Forest 其中hbycrsj.com是我实验环境中的域名
5、使用LDP.exe修改
运行LDP.exe,选择菜单中connect连接到服务器,然后选择bind
在VIEW菜单中选择TREE,选择如下图
Windows Server 2008 R2之活动目录回收站
右键CN=Partitions容器,选择modify,
Windows Server 2008 R2之活动目录回收站
修改msDS-Behavior-Version值为4
Windows Server 2008 R2之活动目录回收站
三、启用活动目录回收站
有以下几种方法
1、使用Active Directory Module for Windows PowerShell启用
打开管理工具中的Active Directory Module for Windows PowerShell,输入Enable-ADOptionalFeature –Identity 'CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration, DC=HBYCRSJ,DC=com' –Scope ForestOrConfigurationSet –Target 'hbycrsj.com'
Windows Server 2008 R2之活动目录回收站
2、使用LDP.EXE
运行LDP后的有关过程见前面,(使用LDP修改林功能级别)
在Edit Entry Attribute, 输入 enableOptionalFeature
在Values, 输入 CN=Partitions,CN=Configuration,DC=hbycrsj,DC=com:766ddcd8-acd0-445e-f3b9-a7f9b6744f2a
(766ddcd8-acd0-445e-f3b9-a7f9b6744f2a是活动目录回收站的GUID)
选择ADD,选择RUN。
Windows Server 2008 R2之活动目录回收站
四、测试活动目录回收站
为了测试目录回收站这项新功能,我先建立一个用户USER001,接着将其删除。
1、显示已删除对象容器
运行LDP.exe,在Option菜单中选择Control,在Load Predefined 的下拉列表中选择Return deleted objects,确定。
Windows Server 2008 R2之活动目录回收站
选择“Connect”,然后选择“Bind”。选择Tree菜单中的View,在BaseDN选择DC=hbycrsj,DC=com.
会出现CN=Deleted Objects, DC=hbycrsj,dc=com这个容器,并在它的下面一个已删除的对象user001
Windows Server 2008 R2之活动目录回收站
2、恢复删除的对象
使用LDP恢复删除的对象
运行LDP.EXE,选择Connect,然后选择Bind.浏览到CN=Deleted Objects,找到USER001这个对象,选择Modify,在出现的对话进行如下选择
Edit Entry Attribute, 输入 isDeleted.让Values为空;在Operation选择 Delete,然后选择Enter
Windows Server 2008 R2之活动目录回收站
再在Edit Entry Attribute, 输入 distinguishedName。Values输入CN=USER001,CN=USERS,DC=HBYCRS,DC=GOV。在 Operation, 选择 Replace
然后勾选 Extended 选择Enter, 单击Run.
Windows Server 2008 R2之活动目录回收站
此时重新连接,重新查看,会好现cn=deleted容器下的删除对象user001没有。同时打开活动用户和计算机,会发现user001恢复。
 
使用 Active Directory Module for Windows PowerShell进行恢复
打开Active Directory Module for Windows PowerShell,输入
Get-ADObject -Filter {displayname -eq "USER001"} -IncludeDeletedObjects | Restore-ADObject
 

















本文转自ycrsjxy51CTO博客,原文链接:http://blog.51cto.com/ycrsjxy/203129,如需转载请自行联系原作者