Base de connaissances

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.

Identificateur de l'article : SLN156497

Date de la dernière modification : 09/04/2014 10:47 AM

Évaluer cet article

Facile à comprendre
Cet article était-il utile?
Oui Non
Envoyez-nous votre évaluation
L’évaluation contient un caractère non valide ; les caractères spéciaux interdits sont <> () &#92;
Désolés, notre système d’évaluation n’est pas accessible actuellement. Veuillez réessayer plus tard.

Merci. Votre évaluation a été envoyée.