Q. How do I enable the Active Directory (AD) Recycle Bin?
June 14, 2009
To learn more about the Active Directory Recycle Bin, see this FAQ.
A. Once you've raised the forest level to Windows Server 2008 R2, you need to use the Enable-ADOptionalFeature cmdlet to enable the Recycle Bin for the forest. Remember, once you enable this you can't disable, so be sure you really want this functionality.
The format of the command is shown here:
Enable-ADOptionalFeature -Identity 'CN=Recycle Bin Feature,CN=OptionalFeatures,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,' -ScopeForestOrConfigurationSet -Target ''
You can check if the Recycle Bin is enabled by viewing the AD Option features:
PS C:> Get-ADOptionalFeature -filter {name -like "*"}
DistinguishedName : CN=Recycle Bin Feature,CN=OptionalFeatures,CN=Directory Service,CN=WindowsNT,CN=Services,CN=Configuration,DC=savilltech,DC=netEnabledScopes : {}FeatureGUID : 766ddcd8-acd0-445e-f3b9-a7f9b6744f2aFeatureScope : {ForestOrConfigurationSet}IsDisableable : FalseName : Recycle Bin FeatureObjectClass : msDS-OptionalFeatureObjectGUID : 3a54f214-699d-4231-a836-3d34a7720d40RequiredDomainMode :RequiredForestMode : Windows2008R2Forest
You can see in the above output there are no enabled scopes for the Recycle Bin, so the Recycle Bin isn't enabled. I now enable the feature:
PS C:> Enable-ADOptionalFeature -Identity'CN=Recycle Bin Feature,CN=Optional Features,CN=DirectoryService,CN=Windows NT,CN=Services,CN=Configuration,DC=savilltech,DC=net' -Scope ForestOrConfigurationSet-Target 'savilltech.net'WARNING: Enabling 'Recycle Bin Feature' on'CN=Partitions,CN=Configuration,DC=savilltech,DC=net'is an irreversible action! You will not be able todisable 'Recycle Bin Feature' on 'CN=Partitions,CN=Configuration,DC=savilltech,DC=net' if you proceed.ConfirmAre you sure you want to perform this action?Performing operation "Enable" on Target "Recycle Bin Feature".[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help(default is "Y"):y
The recycle bin is now enabled. I can check this by checking the AD option features again and seeing that the Recycle Bin now has enabled scopes.
PS C:> Get-ADOptionalFeature -filter {name -like "*"}DistinguishedName : CN=Recycle Bin Feature,CN=OptionalFeatures,CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=savilltech,DC=net EnabledScopes :{CN=NTDS Settings,CN=SAVDALDC01,CN=Servers,CN=Dallas,CN=Sites,CN=Configuration,DC=savilltech,DC=net,CN=Partitions,CN=Configuration,DC=savilltech,DC=net}FeatureGUID : 766ddcd8-acd0-445e-f3b9-a7f9b6744f2aFeatureScope : {ForestOrConfigurationSet}IsDisableable : FalseName : Recycle Bin FeatureObjectClass : msDS-OptionalFeatureObjectGUID : 3a54f214-699d-4231-a836-3d34a7720d40RequiredDomainMode :RequiredForestMode : Windows2008R2Forest
Related Reading:
Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.
About the Author
You May Also Like