# Recycle Bin status should be retrievable

The Active Directory Recycle Bin provides significant advantages over traditional tombstone reanimation:

Source: https://maester.dev/docs/tests/AD-FOR-04

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/soulemike" title="Michael Soule · Original author"><img src="https://github.com/soulemike.png" alt="Michael Soule" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/soulemike">Michael Soule</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/ad">Active Directory</a> · Active Directory · Directory configuration · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId AD-FOR-04
```

## Overview

The Active Directory Recycle Bin provides significant advantages over traditional tombstone reanimation:

- **Complete Object Recovery**: Restores all object attributes, group memberships, and links
- **Simplified Recovery**: No need to restore from backup for accidental deletions
- **Reduced Downtime**: Faster recovery of critical objects
- **Attribute Preservation**: Unlike tombstone reanimation, all attributes are preserved

**Requirements**:
- Forest functional level of Windows Server 2008 R2 or higher
- Must be explicitly enabled (not enabled by default)

#### Control Type

**Preventive**

#### Security Recommendation

**Enable the Recycle Bin** if your forest functional level supports it:

```powershell
Enable-ADOptionalFeature -Identity "Recycle Bin Feature" -Scope ForestOrConfigurationSet -Target "yourforest.com"
```

**Important Considerations**:
- **Irreversible**: Once enabled, the Recycle Bin cannot be disabled
- **Database Size**: Increases AD database size due to preserved objects
- **Tombstone Lifetime**: Objects are retained for the tombstone lifetime period
- **Planning**: Ensure adequate disk space and backup strategies

#### How the Test Works

This test checks the optional features in Active Directory to determine if the Recycle Bin Feature is enabled and reports its status.

#### Related Tests

- `Test-MtAdTombstoneLifetime` - Retrieves the tombstone lifetime (affects Recycle Bin retention)
- `Test-MtAdForestFunctionalLevel` - Retrieves the forest functional level (required for Recycle Bin)

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | AD-FOR-04 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Directory configuration |
| Area | Infrastructure hardening |
| Resource type | Tenant |
| MITRE ATT&CK | None |
| PowerShell test | [Test-MtAdRecycleBinStatus](https://github.com/maester365/maester/blob/main/tests/ad/domain/Test.AD-FOR-04.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:crossRef:ReadProperty, ActiveDirectory:Ldap:msDS-OptionalFeature:ReadProperty |

</details>

## Source

- Test: [`tests/ad/domain/Test.AD-FOR-04.ps1`](https://github.com/maester365/maester/blob/main/tests/ad/domain/Test.AD-FOR-04.ps1)
- Documentation: [`tests/ad/domain/Test.AD-FOR-04.md`](https://github.com/maester365/maester/blob/main/tests/ad/domain/Test.AD-FOR-04.md)
