【經驗分享】Windows 2008 R2活動目錄回收站
參考這篇博文(配置Windows 2008 R2活動目錄回收站),成功啟用AD回收站,
實驗結果總結:用LDP.exe工具啟用跟還原都不成功,用Power shell命令成功,步驟如下:
1、啟用回收站命令
Enable-ADOptionalFeature –Identity ‘CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration, DC=CONTOSO,DC=com‘ –Scope ForestOrConfigurationSet –Target ‘contoso.com‘
2、查看回收站狀態
get-adoptionalfeature -filter {name -like "*"}
3、查看對象狀態
Get-ADObject -SearchScope subtree -Filter {name -like "*"} -IncludeDeletedObjects
或者Get-ADObject -SearchScope subtree -Filter {name -like "*user1*"} -IncludeDeletedObjects
作個刪除操作,把user1用戶帳號刪除掉。
~~刪除前:
Deleted :
DistinguishedName : OU=test,DC=contoso,DC=com
Name : test
ObjectClass : organizationalUnit
ObjectGUID : 610b87d9-77e4-48be-8b1d-dbd58ca9d7c8
Deleted :
DistinguishedName : CN=user1,OU=test,DC=contoso,DC=com
Name : user1
ObjectClass : user
ObjectGUID : 7b24079e-06a8-4d98-9566-e9e9454676c6
~~刪除後:
Deleted : True
DistinguishedName : OU=test\0ADEL:610b87d9-77e4-48be-8b1d-dbd58ca9d7c8,CN=Delet
ed Objects,DC=contoso,DC=com
Name : test
DEL:610b87d9-77e4-48be-8b1d-dbd58ca9d7c8
ObjectClass : organizationalUnit
ObjectGUID : 610b87d9-77e4-48be-8b1d-dbd58ca9d7c8
Deleted : True
DistinguishedName : CN=user1\0ADEL:7b24079e-06a8-4d98-9566-e9e9454676c6,CN=Dele
ted Objects,DC=contoso,DC=com
Name : user1
DEL:7b24079e-06a8-4d98-9566-e9e9454676c6
ObjectClass : user
ObjectGUID : 7b24079e-06a8-4d98-9566-e9e9454676c6
4、還原刪除的容器或OU或用戶:
(如果有一個包含用戶的OU需要還原,必須先還原OU,然後再還原用戶)
Restore-ADobject -Identity 610b87d9-77e4-48be-8b1d-dbd58ca9d7c8
Restore-ADobject -Identity 7b24079e-06a8-4d98-9566-e9e9454676c6
還原成功,Ou Yeh!
本文出自 “繁星點點” 博客,請務必保留此出處http://fanxing.blog.51cto.com/189800/1954789
【經驗分享】Windows 2008 R2活動目錄回收站