Knowledge Base

How to Recover Deleted Objects Using the Active Directory Recycle Bin in Windows Server 2008 R2

Article Summary: This article provides information on using the Active Directory Recycle Bin to recover deleted objects in Windows Server 2008 R2.

For general information about the Active Directory Recycle Bin, see Information About the Active Directory Recycle Bin in Windows Server 2008 R2 and 2012.
For information on enabling the AD Recycle Bin, see How to Enable the Active Directory Recycle Bin in Windows Server 2008 R2.
For information on recovering deleted objects in Windows Server 2012, see How to Recover Deleted Objects Using the Active Directory Recycle Bin in Windows Server 2012.

Follow this procedure to restore a deleted object using Windows PowerShell:

  1. Run the Active Directory Module for Windows PowerShell as Administrator.
    Alternatively, run Windows PowerShell as Administrator and run the Import-Module ActiveDirectory cmdlet.
  2. Use the Get-ADObject and Restore-ADObject cmdlets to restore deleted objects. For example, to restore a user account with the display name John Doe, type the following:

    Get-ADObject -Filter {displayName -eq "John Doe"} -IncludeDeletedObjects | Restore-ADObject

    In this example, the Get-ADObject cmdlet searches for an object whose display name is John Doe. The -IncludeDeletedObjects parameter indicates that the search can include the Deleted Objects container. If a matching object is found, that object is sent to the Restore-ADObject cmdlet, which retrieves it from the Deleted Objects container and restores it to its previous location in AD. It is possible to restore multiple objects using the same cmdlets by specifying a filter that matches all of the objects to restore.

The Restore-ADObject cmdlet uses the lastKnownParent attribute of a deleted object to determine the location in AD to which it should be restored. To restore objects to a different location, use the -TargetPath parameter.

The location to which a deleted object is restored must be a "live" location; it cannot also be a deleted object. In other words, if a hierarchy of deleted objects must be restored, the highest-level object in the hierarchy must be restored first. For example, if an organizational unit (OU) named Sales is deleted along with all of the user accounts it contains, the Sales OU must be restored before the user accounts can be restored, unless the user accounts are restored to a different, valid location.
Detailed steps for restoring a hierarchy of deleted objects are given in Step 2: Restore a Deleted Active Directory Object. The same TechNet article also gives instructions for restoring deleted objects using the ldp.exe utility.

Quick Tips content is self-published by the Dell Support Professionals who resolve issues daily. In order to achieve a speedy publication, Quick Tips may represent only partial solutions or work-arounds that are still in development or pending further proof of successfully resolving an issue. As such Quick Tips have not been reviewed, validated or approved by Dell and should be used with appropriate caution. Dell shall not be liable for any loss, including but not limited to loss of data, loss of profit or loss of revenue, which customers may incur by following any procedure or advice set out in the Quick Tips.

Article ID: SLN156497

Last Date Modified: 09/04/2014 10:47 AM

Rate this article

Easy to understand
Was this article helpful?
Yes No
Send us feedback
Comments cannot contain these special characters: <>()\
Sorry, our feedback system is currently down. Please try again later.

Thank you for your feedback.