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:
- 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.")
- In the console tree, right-click the object you want to restore. Select Modify from the contextual menu.
- In the Modify dialog box (see Figure 10), type isDeleted in the Edit Entry Attribute field.
- In the Operation section of the dialog box, select Delete.
- Click the Enter button. The dialog box is refreshed with more details displayed (see Figure 11).
- Type distinguishedName in the Edit Entry Attribute field.
- In the Values field, type the original distinguished name of the Active Directory object.
- In the Operation section, select Replace.
- Select the Extended checkbox at lower left in the dialog box.
- Click the Enter button and then click Run.
Figure 10 Modifying the isDeleted attribute.
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:
- 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.")
- 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:
- Press Enter.
Get-ADObject -Filter {displayName -eq "User1"} -IncludeDeletedObjects | Restore-ADObject
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.