June 15, 2021

What is Active Directory Recycle Bin Feature and What Does It Do?

With the Active Directory Recycle Bin feature, we can recover a deleted Active Directory object. This feature is very important for system administrators who frequently use Active Directory, such as changes and deletions. Apart from this, a group or user that has been accidentally deleted can be taken back to their old location or to a different location specified. Also, when we bring back a user we deleted, their old group memberships are restored. When Active Directory Recycle Bin feature is activated, it cannot be disabled again.

Activating Active Directory Recycle Bin

Active Directory Recycle Bin does not come active by default. To start using it, we need to activate it. For this, we come to the area where our domain name is written on the “Active Directory Administrative Center” screen and click on the “Enable Recycle Bin” option.

Enable Recycle Bin
Enable Recycle Bin

 

After clicking the Enable Recycle Bin option, we see a screen asking if we want to activate the Recycle Bin feature. On the screen that appears, there is also the information that once Active Directory Recycle Bin is activated, it cannot be returned to a disabled state. By pressing the “OK” button, we activate the Recycle Bin feature.

Enable Recycle Bin Confirmation
Enable Recycle Bin Confirmation

 

After completing our operations, when we refresh the “Active Directory Administrative Center” screen, you can see that the “Enable Recycle Bin” option at the bottom right has become inactive.

Enable Recycle Bin
Enable Recycle Bin

 

PowerShell Command

We can check whether “Active Directory Recycle Bin” is active or not from PowerShell. You can use the command “Get-ADOptionalFeature -filter *” to control it from PowerShell.

LEARN MORE  What is Karmetasploit? What Does It Do? How to Install Karmetasploit?

Get-ADOptionalFeature -filter *
Get-ADOptionalFeature -filter *

 

Active Directory Recycle Bin Restore

After activating the Active Directory Recycle Bin feature, we will delete a user in our structure and bring back that user. We delete the user named “asaf” under the “IT Users” OU.

Active Directory Recycle Bin Restore
Active Directory Recycle Bin Restore

 

You can see that the user has been deleted on the screen below.

user has been deleted
user has been deleted

 

Deleted user objects are kept in “Deleted Objects” in “Active Directory Administrative Center“. By right-clicking on the user or under the “Tasks” area at the top right, “Restore” and “Restore To” options appear.

To explain the options here, “Restore” brings the object back to the location before it was deleted. “Restore To“, on the other hand, allows us to restore the object to a location we want, other than the original location it was deleted.

Here, we want the object to be restored by selecting the “Restore” option.

Restore
Restore

 

After performing the restore process, you will see that it comes back under the “IT Users” OU, as in the picture below.

 

Leave a Reply

Your email address will not be published. Required fields are marked *