Wednesday, 12 March 2014

2008R2: How to restore deleted AD object after enabling Active Directory Recycle Bin

After enabling Active Directory Recycle Bin in Server 2008R2 you can recover deleted AD object.
But you need to track it fiirst.
When you don't remember where you deleted object resided, use this powershell command to recover AD object.
(replace objectlastnamehere with the name of your object)

Get-ADObject -SearchBase "CN=Deleted Objects,DC=domain,DC=domain" -ldapFilter:"(msDs-lastKnownRDN=objectlastnamehere)" –IncludeDeletedObjects –Properties lastKnownParent |Restore-ADObject

No comments:

Post a Comment