Windows Server 2008 R2 includes a feature that can be enabled called the Active Directory Recycle Bin. When enabled, this feature can allow for a deleted Active Directory object to be restored without having to restore the System State of a domain controller and boot to Directory Services Restore mode to perform a selective authoritative restore of that object. Enabling the Active Directory Recycle Bin requires that all domain controllers are running Windows Server 2008 R2, the forest functional level must be set to Windows Server 2008 R2, and then functionality can be enabled manually. To enable the Active Directory Recycle Bin, perform the following steps:
1. Log on to a Windows Server 2008 R2 domain controller in the forest root domain with an account with domain administrator privileges.
2. Click Start, click All Programs, click Accessories, click the Windows PowerShell folder, right-click on Windows PowerShell, and select Run As Administrator.
3. Type cd \ and press Enter.
4. Type Import-Module ActiveDirectory and press Enter.
5. Type Get-ADForest and press Enter. Review the ForestMode value, which should be set to Windows2008R2Forest.
6. If the ForestMode is not set to Windows2008R2Forest, for a forest named companyabc.com as an example, type Set-ADForestMode –Identity companyabc.com -ForestMode Windows2008R2Forest and press Enter. Type a Y and press Enter to confirm the change.
7. Once the forest functional level is confirmed to be at the Windows Server 2008 R2 level, type in Get-ADOptionalFeature –Filter * and press Enter. This returns the list of optional features, including the Active Directory Recycle Bin. If this feature is enabled, the EnabledScopes setting will have a value.
8. Assuming that this functionality has not been enabled, as it is not enabled by default, type Enable-ADOptionalFeature ‘Recycle Bin Feature’ –Scope ForestorConfigurationSet –Target companyabc.com and press Enter.
9. When prompted that this is an irreversible action, type Y and press Enter to enable the Active Directory Recycle Bin feature.
10. After the command completes, type Get-ADOptionalFeature –Filter * and press Enter. Note that the EnabledScopes setting is now populated with a value.
11. Type exit and press Enter to close the PowerShell window. After the Active Directory Recycle Bin is enabled, it should be tested with test organizational units, groups, users, or any desired objects. To perform a restore, the Restore-ADObject cmdlets will be used along with a few other cmdlets to get the preliminary information needed to restore.
Source of Information : Sams - Windows Server 2008 R2 Unleashed