How to Enable Active Directory Recycle Bin in Windows Server 2008 R2 and How to Restore Single Deleted Object using Shell.

Before we begin

The account with which we are going to perform this steps must be a member of Domain Admins and Enterprise Admins Group.

The Forest Functional level should be Windows Server 2008 R2.

Best Practices

It is always recommended to have a proper system state backup. To know how to perform system state backup in 2008 machines please click here. Recycle bin is just an option in Windows Server 2008 R2. Once enabling this feature it cannot be reversed under any circumstances. So plan accordingly.


One Domain Controller by the name as follows.


Forest Functional Level : Windows Server 2008 R2.

By Default Recycle bin is not enabled. We have to enable them manually.

Below is the step by step scenario on how to restore single AdOject which was deleted.


Figure 1.1 : Object which will be deleted.

Before deleting the object we have to enable Recycle Bin.


Figure 2.1 : Importing Active Directory Module.

In figure 2.1 we import Active Directory Module to install Ad Optional Features.


Figure 2.2 : Enable AdOptionalFeature.


Enable-ADOptionalFeature –Identity ‘CN=Recycle Bin Feature,CN=Optional Features,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=MSEXCHANGETEAM,DC=IN’ –Scope ForestOrConfigurationSet –Target ‘MSEXCHANGETEAM.IN’

Figure 2.3 : Command for reference.


Figure 3.1 : Object marked for deletion.


Get-AdObject -Filter {displayname -eq “Sunder”} -IncludeDeletedObjects | Restore-ADObject

Figure 4.1 : Command to restore AdObject


Figure 5.1 : Object Restored Successfully.

Thanks to Microsoft for bringing such a wonderful feature for which Windows Administrators waited for almost a decade.

In the next part series we will walk you through the steps using LDP.exe tool.

Courtesy Microsoft.

Disclaimer : The above scenario is thoroughly tested on lab. Please ensure that MSEXCHANGETEAM.IN would not be held responsible for any data loss or outage by following the above steps. Please read the documents carefully before proceeding further.

Happy Learning



Like this post? Please share to your friends:
Comments: 1
  1. Fedrik

    You can also try the third party tool for the same.This tool have the options to restore the deleted objects with advanced options.

    Try the link :

Leave a Reply