# Optional features count should be retrievable

Active Directory optional features (and related feature flags) enable or enhance behaviors such as recoverability and directory management capabilities.

Source: https://maester.dev/docs/tests/AD-CFG-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-CFG-04
```

## Overview

Active Directory **optional features** (and related feature flags) enable or enhance behaviors such as recoverability and directory management capabilities. Incorrectly enabled/disabled features can materially affect your security posture by:

- Reducing your ability to recover from accidental or malicious deletion
- Leaving legacy behaviors in place longer than necessary
- Causing operational drift that attackers can exploit via misconfiguration

In particular, features that improve recovery (such as those related to the Recycle Bin) directly impact resilience during incidents.

#### Control Type

**Operational**

#### Security Recommendation
- Ensure critical recoverability features (notably **Recycle Bin**) are enabled for the partitions that contain important identity data.
- Treat optional feature changes as **security configuration changes**: use a change control process, test first, and validate after enabling/disabling.
- Keep optional feature configuration consistent across domains/partitions where required.

#### How the Test Works
This test retrieves the set of enabled AD optional feature flags and reports them as a count/visibility metric so administrators can confirm whether the expected security-enhancing features are active.

#### Related Tests
- `Test-MtAdRecycleBinEnabledPaths` - Shows where Recycle Bin is enabled.
- `Test-MtAdRecycleBinStatus` - Validates the Recycle Bin state.

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-CFG-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-MtAdOptionalFeaturesCount](https://github.com/maester365/maester/blob/main/tests/ad/config/Test.AD-CFG-04.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:msDS-OptionalFeature:ReadProperty |

</details>

## Source

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