Site icon Windows Active Directory

Active Directory Recycle Bin 

What is Active Directory Recycle Bin? 

The Active Directory Recycle Bin feature allows administrators to restore deleted AD objects. In Active Directory, objects such as users, computers, groups, or organizational units may be unintentionally removed. Administrators may find it difficult to correct such mistakes. Therefore, for administrators to easily retrieve deleted objects, Microsoft launched an Active Directory Recycle Bin, which is quite similar to the Windows Recycle Bin. The AD Recycle Bin facilitates the recovery of deleted items as well as their properties and allows services to continue operating while the restoration is being done, without the need for backup restoration, restarting Active Directory Domain Services, or rebooting domain controllers.

The following prerequisites must be met in order to use the Active Directory Recycle Bin feature:

How does the Active Directory Recycle Bin work? 

When an AD object is removed in a domain equipped with an AD Recycle Bin, it is first stored in the deleted objects container with all of its attributes for a deleted object lifetime period. The object can be restored with all of its attributes retained during the Deleted Object Lifetime period. When an object’s Deleted Object life period expires, it is shifted to the Recycled Object state, where most of its properties  (other than Object- GUID, Object-SID, Object-Dist-Name, USN) are erased, and the object is deleted from the database. The deleted object time period is controlled by the msDS-DeletedObjectLifetime attribute. If no value for the attribute is specified, the deleted object lifetime is set to the tombstone lifetime. The deleted object time period default to 60 days, if the value of the tombstoneLifetime attribute is not specified.

How to enable the Active Directory Recycle Bin? 

The AD Recycle Bin is not enabled by default, and you must manually enable it to access this useful function. Also, it should be noted that enabling an Active Directory Recycle Bin is irreversible. You can enable the Active Directory recycle bin using AD Administrative Center or using PowerShell. Follow the below steps to enable the Active Directory Recycle Bin in your domain:

  1. Using ADAC:

Note: To check if the recycle bin is enabled, look for a new container called Deleted Objectsin the domain.

 Active Directory Recycle Bin 

Table of Contents
What is Active Directory Recycle Bin?
How does the Active Directory Recycle Bin work?
How to enable the Active Directory Recycle Bin?
What happens if the Active Directory Recycle Bin is not enabled?
How to recover objects from AD Recycle Bin?
What are the best practices for using AD Recycle Bin
Benefits of AD Recycle Bin
Drawbacks of the AD Recycle Bin

 What is Active Directory Recycle Bin? 

The Active Directory Recycle Bin feature allows administrators to restore deleted AD objects. In Active Directory, objects such as users, computers, groups, or organizational units maybe unintentionally removed. Administrators may find it difficult to correct such mistakes. Therefore, for administrators to easily retrieve deleted objects, Microsoft launched an Active Directory Recycle Bin, which is quite similar to the Windows Recycle Bin. The AD Recycle Bin facilitates the recovery of deleted items as well as their properties and allows services to continue operating while the restoration is being done, without the need for backup restoration, restarting Active Directory Domain Services, or rebooting domain controllers.

The following prerequisites must be met in order to use the Active Directory Recycle Bin feature:

 How does the Active Directory Recycle Bin work? 

When an AD object is removed in a domain equipped with an AD Recycle Bin, it is first stored in the deleted objects container with all of its attributes for a deleted object lifetime period. The object can be restored with all of its attributes retained during the Deleted Object Lifetime period. When an object’s Deleted Object life period expires, it is shifted to the Recycled Object state, where most of its properties  (other than Object- GUID, Object-SID, Object-Dist-Name, USN) are erased, and the object is deleted from the database. The  deleted object time period is controlled by  the msDS-DeletedObjectLifetime attribute. If no value for the attribute is specified, the deleted object lifetime is set to the tombstone lifetime. The deleted object time period default to 60 days, if the value of the tombstoneLifetime attribute is not specified.

   How to enable the Active Directory Recycle Bin? 

The AD Recycle Bin is not enabled by default, and you must manually enable it to access this useful function. Also, it should be noted that enabling an Active Directory Recycle Bin is irreversible. You can enable the Active Directory recycle bin using AD Administrative Center or using PowerShell. Follow the below steps to enable the Active Directory Recycle Bin in your domain:

  1. Using ADAC:

Note: To check if the recycle bin is enabled, look for a new container called Deleted Objectsin the domain.

  1. Using PowerShell

Import-Module ActiveDirectory
Enable-ADOptionalFeature –Identity “CN=Recycle Bin

Feature,CN=Optional Features,CN=Directory Service,CN=Windows

NT,CN=Services,CN=Configuration,DC=domain” –Scope

ForestOrConfigurationSet –Target “ <yourdomainname> ”

 What happens if the Active Directory Recycle Bin is not enabled? 

When an Active Directory object is deleted from a domain that does not have an AD Recycle Bin, the majority of its properties are erased, and the object (called as Tombstone) is stored in the partition’s deleted objects container for the time period specified in the domain’s tombstone lifetime value. Despite the fact that the object is potentially recoverable at this point, its lost properties are irrecoverable. The object gets destroyed from the database when the tombstone lifetime value is reached. The tombstone’s lifetime period is defined in the tombstoneLifetime attribute. If the tombstoneLifetime attribute is not given, it is set to 60 days. The shortest period that can be specified is two days.

 How to recover objects with Active Directory Recycle Bin? 

Follow the below instructions to restore deleted objects from AD recycle bin. Please note that you will be able to successfully restore the objects only if  the lifetime of the object is not expired and also AD recyle bin is enabled.

  1. Using ADAC:
  1. Using PowerShell:

Get-ADObject -ldapFilter:”(msDS-LastKnownRDN=*)” – IncludeDeletedObjects

Get-ADObject -Filter {displayName -eq “nameofdeletedobject”} IncludeDeletedObjects | Restore-ADObject

 What are the best practices for using an AD Recycle Bin? 

 Benefits of an AD Recycle Bin: 

 Drawbacks of an AD Recycle Bin: 

The AD Recycle Bin enables administrators to recover directory objects quickly, without relying on System State backups. It is helpful when you mistakenly remove an object and need to recover it. The AD Recycle Bin is a vital tool in the day-to-day operations of an Active Directory domain. It is a lifesaver for the IT department, and the organization benefits greatly from reduced operational risk as a result of it.

Import-Module ActiveDirectory
Enable-ADOptionalFeature –Identity “CN=Recycle Bin

Feature,CN=Optional Features,CN=Directory Service,CN=Windows

NT,CN=Services,CN=Configuration,DC=domain” –Scope

ForestOrConfigurationSet –Target “ <yourdomainname> ”

 What happens if the Active Directory Recycle Bin is not enabled? 

When an Active Directory object is deleted from a domain that does not have an AD Recycle Bin, the majority of its properties are erased, and the object (called as Tombstone) is stored in the partition’s deleted objects container for the time period specified in the domain’s tombstone lifetime value. Despite the fact that the object is potentially recoverable at this point, its lost properties are irrecoverable. The object gets destroyed from the database when the tombstone lifetime value is reached. The tombstone’s lifetime period is defined in the tombstoneLifetime attribute. If the tombstoneLifetime attribute is not given, it is set to 60 days. The shortest period that can be specified is two days.

 How to recover objects with Active Directory Recycle Bin? 

Follow the below instructions to restore deleted objects from AD recycle bin. Please note that you will be able to successfully restore the objects only if  the lifetime of the object is not expired and also AD recyle bin is enabled.

  1. Using ADAC:
  1. Using PowerShell:

Get-ADObject -ldapFilter:”(msDS-LastKnownRDN=*)” – IncludeDeletedObjects

Get-ADObject -Filter {displayName -eq “nameofdeletedobject”} IncludeDeletedObjects | Restore-ADObject

What are the best practices for using an AD Recycle Bin? 

Benefits of an AD Recycle Bin: 

Drawbacks of an AD Recycle Bin: 

The AD Recycle Bin enables administrators to recover directory objects quickly, without relying on System State backups. It is helpful when you mistakenly remove an object and need to recover it. The AD Recycle Bin is a vital tool in the day-to-day operations of an Active Directory domain. It is a lifesaver for the IT department, and the organization benefits greatly from reduced operational risk as a result of it.

Exit mobile version