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

一、先决条件

更新活动目录架构

1、在架构操作主控(schema master operations master)角色的DC运行adprep /forestprep

2、在基础架构主控 infrastructure operations master 角色的DC上运行adprep /domainprep /gpprep

一般来说,活动目录的五种角色会放在一台DC上,可以通过命令netdom query fsmo查看角色情况,还可以在通过活动目录用户和计算机、活动目录域和信任管理控制台查看

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s14.sinaimg.cn/bmiddle/53e059e3h6eb5be1b308d&690">

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s14.sinaimg.cn/bmiddle/53e059e3h6eb5bed66f5d&690" real_src="http://s14.sinaimg.cn/bmiddle/53e059e3h6eb5bed66f5d&690">

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s11.sinaimg.cn/bmiddle/53e059e3h6eb5c330b6aa&690" real_src="http://s11.sinaimg.cn/bmiddle/53e059e3h6eb5c330b6aa&690">

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s7.sinaimg.cn/bmiddle/53e059e3h6eb5c4f53406&690" real_src="http://s7.sinaimg.cn/bmiddle/53e059e3h6eb5c4f53406&690">

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s11.sinaimg.cn/bmiddle/53e059e3h6eb5c6078a4a&690" real_src="http://s11.sinaimg.cn/bmiddle/53e059e3h6eb5c6078a4a&690">

3、在只读域控制器(RODC)上运行adprep /rodcprep

4、确保域中所有的DC安装Windows Server 2008 R2

 

二、提升活动目录功能级别

活动目录回收站中Windows Server 2008 R2功能级别所具有的新特性之一,所以须将森林级别提升为Windows Server 2008 R2。

提升方法有以下几种

1、活动目录域和信任管理控制台

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s10.sinaimg.cn/bmiddle/53e059e3h6eb5e1453319&690" real_src="http://s10.sinaimg.cn/bmiddle/53e059e3h6eb5e1453319&690">

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s12.sinaimg.cn/bmiddle/53e059e3h6eb5e22e9d5b&690" real_src="http://s12.sinaimg.cn/bmiddle/53e059e3h6eb5e22e9d5b&690">

2、活动目录管理中心(DSAC.exe)

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s9.sinaimg.cn/bmiddle/53e059e3h6eb5f9050088&690" real_src="http://s9.sinaimg.cn/bmiddle/53e059e3h6eb5f9050088&690">

3、通过ADSIedit.msc进行编辑

运行ADSIedit.msc,连接到配置分区,操作如下图。修改msDS-Behavior-Version值为4

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s12.sinaimg.cn/bmiddle/53e059e3h6eb5fca8875b&690" real_src="http://s12.sinaimg.cn/bmiddle/53e059e3h6eb5fca8875b&690">

活动目录级别目前有四种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,选择如下图

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s11.sinaimg.cn/bmiddle/53e059e3h6eb63f6fbe2a&690" real_src="http://s11.sinaimg.cn/bmiddle/53e059e3h6eb63f6fbe2a&690">

右键CN=Partitions容器,选择modify,

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s16.sinaimg.cn/bmiddle/53e059e3h6eb64477d98f&690" real_src="http://s16.sinaimg.cn/bmiddle/53e059e3h6eb64477d98f&690">

修改msDS-Behavior-Version值为4

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s9.sinaimg.cn/bmiddle/53e059e3h6eb647b26cf8&690" real_src="http://s9.sinaimg.cn/bmiddle/53e059e3h6eb647b26cf8&690">

 

 三、启用活动目录回收站

有以下几种方法

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'

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s11.sinaimg.cn/bmiddle/53e059e3h6eb83fb480ca&690" real_src="http://s11.sinaimg.cn/bmiddle/53e059e3h6eb83fb480ca&690">

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。

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s8.sinaimg.cn/bmiddle/53e059e3h6eb859437a47&690" real_src="http://s8.sinaimg.cn/bmiddle/53e059e3h6eb859437a47&690">

可以通过查看右边的详细信息栏,查看msDS-EnabledFeature属性,发现它的值是 CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration, DC=hbycrsj,DC=com.表明设置成功

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s5.sinaimg.cn/bmiddle/53e059e3h7178d5d3a8c4&690" real_src="http://s5.sinaimg.cn/bmiddle/53e059e3h7178d5d3a8c4&690">

 

四、测试活动目录回收站

为了测试目录回收站这项新功能,我先建立一个用户USER001,接着将其删除。

1、显示已删除对象容器

运行LDP.exe,在Option菜单中选择Control,在Load Predefined 的下拉列表中选择Return deleted objects,确定。

Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s12.sinaimg.cn/bmiddle/53e059e3h6eb8a50ceffb&690" real_src="http://s12.sinaimg.cn/bmiddle/53e059e3h6eb8a50ceffb&690">

选择“Connect”,然后选择“Bind”。选择Tree菜单中的View,在BaseDN选择DC=hbycrsj,DC=com.

会出现CN=Deleted Objects, DC=hbycrsj,dc=com这个容器,并在它的下面一个已删除的对象user001Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s8.sinaimg.cn/bmiddle/53e059e3h6eb8b79b2827&690" width=678 height=341 real_src="http://s8.sinaimg.cn/bmiddle/53e059e3h6eb8b79b2827&690">

2、恢复删除的对象

使用LDP恢复删除的对象

运行LDP.EXE,选择Connect,然后选择Bind.浏览到CN=Deleted Objects,找到USER001这个对象,选择Modify,在出现的对话进行如下选择

Edit Entry Attribute, 输入 isDeleted.让Values为空;在Operation选择 Delete,然后选择Enter
Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s14.sinaimg.cn/bmiddle/53e059e3h6eb91368b74d&690" real_src="http://s14.sinaimg.cn/bmiddle/53e059e3h6eb91368b74d&690">

再在Edit Entry Attribute, 输入 distinguishedName。Values输入CN=USER001,CN=USERS,DC=HBYCRS,DC=GOV。在 Operation, 选择 Replace

然后勾选 Extended 选择Enter, 单击Run.
Server 2008 R2之活动目录回收站" alt="Windows Server 2008 R2之活动目录回收站" src="http://s9.sinaimg.cn/bmiddle/53e059e3h6eb91d7b5f68&690" real_src="http://s9.sinaimg.cn/bmiddle/53e059e3h6eb91d7b5f68&690">

此时重新连接,重新查看,会好现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

转载于:https://www.cnblogs.com/jamin/archive/2011/10/13/2210319.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值