To restore an object in Active Directory ldp.exe or the powershell ADObjects cmdlets can be used.
ldp.exe
- From an elevated command prompt, type ldp.exe
- Click on Connection > Connect and type in the name of the server the host the forest root domain
- Select Bind from the connection menu
- And click OK
- Select controls from the Options menu, this will open the controls dialog box, changing Load Predefined to Return deleted objects, click OK.
- Click on View menu > Tree, selecting the BaseDN from the drop down list
- Navigate to CN=Deleted Objects, expand it and highlight the deleted object
- Select Modify from the Browse menu and do the following
- In the Edit Entry Attribute box, type isDeleted.
- Select Delete in the Operation area.
- Click Enter to move the [Delete]isDeleted item to the Entry List box.
- In the Edit Entry Attribute box, type distinguishedName.
- In the Values box, type the original DN of the Active Directory Object.
- Select Replace in the Operation area and select Extended.
- Click Enter and then click Run to restore the deleted object.
- In the Edit Entry Attribute box, type isDeleted.
This will restore the object in a disabled state, to enable reset the password and enable.
Powershell
If the Active Directory recycle bin has been enabled, then powershell ADObject cmdlet can be used to restore the object.
Get-ADObject -Filter {displayName -eq “Alastair Hill”} -IncludeDeletedObjects | Restore-ADObject