windows2008R2具有活动目录回收站功能,需要林和域功能级别为windows 2008 R2,默认为未启用状态;


启用活动目录回收站

在Powershell中 假设域名是ABC.COM

Enable-ADOptionalFeature –Identity 'CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration, DC=ABC,DC=com' –Scope ForestOrConfigurationSet –Target 'ABC.COM'


恢复删除的用户 test

Get-ADObject -Filter {displayname -eq "test"} -IncludeDeletedObjects | Restore-ADObject


恢复删除的组织单位 testou

Get-ADObject -ldapFilter:"(msDS-LastKnownRDN=testou)" -IncludeDeletedObjects | Restore-ADObject