Usually I’ve seen many Systems Administrators that they delete the objects in Active Directory and recreate it again but I really don’t understand the reason behind the deletion. I can understand the Accidental Deletion (human errors are possible) but no need to create them again.
Microsoft has provided a built-in tool to recover the deleted Objects named Ldp.exe
We will go through the steps on how to recover/restore the accidental deletion of an Active Directory Object.
- Start Run, type exe and click Ok
- Click Connection click Bind and Select Bind with credentials then enter the credentials click Ok
- Go to Options and click Controls
- On the Controls windows select as shown below and click Ok
- Go to View and click Tree, the default DN (distinguishedName) will be shown, click Ok.
- Expand the Connection from the left pane and double click on:
CN:Deleted Objects,DC=domain,DC=com
- Look for the object which was deleted accidently, it would show something like this:
- Right click in the Object which you want to recover and click Modify
- Inside the Edit Entry Attribute: write “isDeleted”, under Operation select Delete, uncheck Extended and click Enter
- Then under Edit Entry Attribute: type distinguishedName, enter the correct distinguishedName Value of the deleted object under Values, under Operation select Replace, Click Enter, Check Extended and click Run
- Then on the left pane you will see that the Object is recovered with the status as ***Call Modify
- Go to Active Directory, browse the original OU and you will find the user account is disabled, set the new password and enable the user.
You are good to go.