Firstly, the functional level of your environment must be set to Windows Server 2008 R2. In order to raise the functional levels, two methods can be used, viz., Set-ADForestMode Active Directory module cmdlet and Ldp.exe. The active directory schema must also be updated using the adprep.exe utility so that the pre-R2 domain controllers are not required before raising the functional levels.
Once the forest functional level of your environment is set to Windows Server 2008 R2, the Active Directory Recycle Bin can be enabled using one of below given two methods:
Using Enable-ADOptionalFeature Cmdlet
Using Ldp.exe
3. Enable Recycle Bin Using Enable-ADOptionalFeature Cmdlet
Below are the steps to enable Recycle Bin Using Enable-ADOptionalFeature Cmdlet
Click Start, click Administrative Tools, right-click Active Directory Module for Windows PowerShell, and then click Run as administrator.
At the Active Directory module for Windows PowerShell command prompt, type the following command, and then press ENTER:Enable-ADOptionalFeature –Identity ‘CN=Recycle Bin Feature,CN=Optional Features, CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=www, DC=domain,DC=com’ –Scope ForestOrConfigurationSet –Target ‘www.domain.com’
4. Enable Recycle Bin Using Ldp.exe
Below are the steps to enable Recycle Bin Using Ldp.exe
To open Ldp.exe, click Start, click Run, and then type ldp.exe.
To connect and bind to the server that hosts the forest root domain of your AD DS environment, under Connection, click Connect, and then click Bind.
Click View, click Tree, in BaseDN, select the configuration directory partition, and then click OK.
In the console tree, double-click the distinguished name of the configuration directory partition, and then navigate to the CN=Partitions container.
Right-click the CN=Partitions container’s distinguished name, and then click Modify.
In the Modify dialog box, make sure that the DN box is empty.
In the Modify dialog box, in Edit Entry Attribute, type enableOptionalFeature.
In the Modify dialog box, in Values, typeCN=Partitions,CN=Configuration,DC=mydomain,DC=com:766ddcd8-acd0-445e-f3b9-a7f9b6744f2a.
Replace mydomain and com with the appropriate forest root domain name of your AD DS environment.