# dSHeuristics count should be retrievable

dSHeuristics is an AD configuration setting that controls behavior for advanced directory features and legacy compatibility.

Source: https://maester.dev/docs/tests/AD-CFG-02

<!-- 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-02
```

## Overview

**dSHeuristics** is an AD configuration setting that controls behavior for advanced directory features and legacy compatibility. Because it influences protocol-level behavior (including areas such as LDAP security expectations and feature gating), an incorrect or unexpected dSHeuristics value can:

- Leave AD behaving in a more **legacy/less secure** mode
- Cause authentication and directory access **inconsistencies** across clients
- Increase the likelihood of **unsafe fallback behaviors** when clients interact with AD

#### Control Type

**Operational**

#### Security Recommendation
- Confirm dSHeuristics is set according to your domain’s **hardening baseline** (and any guidance for your forest/domain functional level).
- Avoid “trial-and-error” changes; instead, validate configuration changes in a controlled test window.
- Prioritize alignment with modern security requirements (including enforcing secure LDAP behavior where applicable).

#### How the Test Works
This test queries AD configuration for the dSHeuristics setting(s) and reports a count-style metric indicating how many relevant dSHeuristics values are present/active so you can assess whether the environment matches your expected security baseline.

#### Related Tests
- `Test-MtAdLdapQueryPolicyCount` - Helps ensure LDAP is protected by sane query limits.

#### Related links

- [Microsoft Learn: dSHeuristics attribute (MS-ADTS)](https://learn.microsoft.com/openspecs/windows_protocols/ms-adts/e5899be4-862e-496f-9a38-33950617d2c5)
- [ANSSI Active Directory checkpoints: Dangerous dsHeuristics settings](https://www.cert.ssi.gouv.fr/uploads/ad_checklist.html#vuln_dsheuristics_bad)

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-CFG-02 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Directory configuration |
| Area | Infrastructure hardening |
| Resource type | Tenant |
| MITRE ATT&CK | None |
| PowerShell test | [Test-MtAdDsHeuristicsCount](https://github.com/maester365/maester/blob/main/tests/ad/config/Test.AD-CFG-02.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:Configuration/*:ReadProperty |

</details>

## Source

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