Recipe 16.17 Restoring a Deleted Object

This recipe must be run against a Windows Server 2003 domain controller.

16.17.1 Problem

You want to restore an object that was previously deleted.

16.17.2 Solution Using a graphical user interface
  1. Open LDP.

  2. From the menu, select Connection Connect.

  3. For Server, enter the name of a domain controller (or leave blank to do a serverless bind).

  4. For Port, enter 389.

  5. Click OK.

  6. From the menu, select Connection Bind.

  7. Enter credentials of a user that can restore the deleted object (only administrators for the domain by default).

  8. Click OK.

  9. From the menu, select Options Controls.

  10. Select Return deleted objects from the Load Predefined selection.

  11. Click OK.

  12. From the menu, select Browse Modify.

  13. For Dn, enter the distinguished name of the deleted object you want to restore.

  14. For Attribute, enter distinguishedName.

  15. For Values, enter the original DN of the object.

  16. For Operation, select Replace.

  17. Click Enter.

  18. For Attribute, enter isDeleted.

  19. For Values, remove any text.

  20. For Operation, select Delete.

  21. Click Enter.

  22. Add mandatory attributes as necessary:

  23. For Attribute, enter <ManadatoryAttribute>.

  24. For Values, enter <MandatoryAttributeValue>.

  25. For Operation, select Add.

  26. Check the box beside Extended.

  27. Click Run.

  28. The results will be displayed in the right pane.

16.17.3 Discussion

Windows Server 2003 supports restoring tombstone (deleted) objects, which have not expired. This is an alternative to performing an authoritative restore for an object that was accidentally deleted. The downside to this approach is that since most attributes that you care about (excluding those in Table 16-1) are not populated on tombstone objects, the restored deleted object will only be a shadow of its former self.

Here are the basic steps to restore a deleted object:

  1. Enable the Return Deleted Objects control (1.2.840.113556.1.4.417).

  2. Remove the isDeleted attribute of the object (do not simply set to FALSE).

  3. Replace the distinguishedName attribute with its new location in the tree.

  4. Restore any mandatory attributes.

This should all be done in a single LDAP operation.

After the object has been restored, you can repopulate any optional attributes that were set previously. By default only members of the administrator groups can restore deleted objects. You can delegate control over restoring deleted objects by granting the Reanimate Tombstone extended right to a user or group. The user or group will also need rights to modify attributes of the restored object including the ability to create child objects in the container the object is restored to.

Granting the privilege to restore objects should be done with caution. A user could restore a user object and after setting the password, login with the account. This could give the user access to resources he was not suppose to have.

16.17.4 See Also

Recipe 16.16 for searching for deleted objects and MSDN: Restoring Deleted Objects

    Chapter 3. Domain Controllers, Global Catalogs, and FSMOs
    Chapter 6. Users
    Appendix A. Tool List