Home > Articles > Operating Systems, Server

  • Print
  • + Share This
From the author of Restoring Deleted Objects

Restoring Deleted Objects

You can restore deleted objects using the ldp.exe utility or by using the Active Directory Module for Windows PowerShell.

Restoring a Deleted Object by Using the ldp.exe Utility

To restore a deleted object by using the ldp.exe utility:

  1. Use the ldp.exe utility to locate the object you want to restore. (For instructions, see the section "Viewing Deleted Objects by Using the ldp.exe Utility.")
  2. In the console tree, right-click the object you want to restore. Select Modify from the contextual menu.
  3. In the Modify dialog box (see Figure 10), type isDeleted in the Edit Entry Attribute field.
  4. In the Operation section of the dialog box, select Delete.
  5. Figure 10 Modifying the isDeleted attribute.

  6. Click the Enter button. The dialog box is refreshed with more details displayed (see Figure 11).
  7. Type distinguishedName in the Edit Entry Attribute field.
  8. In the Values field, type the original distinguished name of the Active Directory object.
  9. In the Operation section, select Replace.
  10. Select the Extended checkbox at lower left in the dialog box.
  11. Click the Enter button and then click Run.
  12. Figure 11 Modifying the distinguishedName attribute.

When you have successfully modified the attribute to restore the deleted object, the object's information disappears in the console tree (see Figure 12).

Figure 12 Compare this figure with Figure 8 to see the information that was restored.

Restoring a Deleted Object by Using the Active Directory Module for Windows PowerShell

To restore a deleted object using the Windows PowerShell, follow these steps:

  1. Use the Active Directory Module for Windows PowerShell to find the Name attribute for the object you want to restore. (For instructions, see the section "Viewing Deleted Objects by Using the Active Directory Module for Windows PowerShell.")
  2. In the Active Directory Module for Windows PowerShell window (see Figure 13), type the following command, replacing User1 with the Name attribute for the object you want to restore:
  3. Get-ADObject -Filter {displayName -eq "User1"} -IncludeDeletedObjects | Restore-ADObject
  4. Press Enter.
  5. Figure 13 Restoring a deleted object by using the Active Directory Module for Windows PowerShell.

The Active Directory Module for Windows PowerShell doesn't report the success of the restore process, but you can locate the object in the directory to verify that it was restored.

  • + Share This
  • 🔖 Save To Your Account