# DC non-standard LDAP port count should be retrievable

Domain controllers typically use the standard LDAP port (389) for directory services communication. Non-standard LDAP ports may indicate:

Source: https://maester.dev/docs/tests/AD-DCD-01

<!-- 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 · Domain controllers · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId AD-DCD-01
```

## Overview

Domain controllers typically use the standard LDAP port (389) for directory services communication. Non-standard LDAP ports may indicate:

- **Custom configurations** that could affect compatibility with standard LDAP clients and tools
- **Security evasion attempts** where alternate ports are used to bypass network monitoring
- **Legacy configurations** that haven't been updated to standard settings
- **Multi-tenant or specialized deployments** with unique port requirements

While non-standard ports may be intentional for specific scenarios, they can cause issues with:
- LDAP client connectivity
- Directory synchronization services
- Authentication protocols expecting standard ports
- Network security monitoring and firewall rules

#### Control Type

**Detective**

#### Security Recommendation

1. **Document intentional deviations**: If non-standard ports are required, ensure they are well-documented with business justification
2. **Review firewall rules**: Ensure proper firewall rules are in place for any non-standard ports
3. **Monitor for unauthorized changes**: Non-standard ports without documentation may indicate unauthorized configuration changes
4. **Consider standardization**: Where possible, use standard ports to simplify management and troubleshooting

#### How the Test Works

This test retrieves all domain controllers and checks their configured LDAP port. The standard LDAP port is 389. The test reports:

- Total number of domain controllers
- Number of DCs using the standard LDAP port (389)
- Number of DCs using non-standard LDAP ports
- Names of DCs with non-standard ports and the specific ports they use

#### Related Tests

- `Test-MtAdDcNonStandardLdapsPortCount` - Checks for non-standard secure LDAP ports
- `Test-MtAdDcSiteCoverageCount` - Analyzes DC distribution across sites

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-DCD-01 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Domain controllers |
| Area | Infrastructure hardening |
| Resource type | DomainController |
| MITRE ATT&CK | None |
| PowerShell test | [Test-MtAdDcNonStandardLdapPortCount](https://github.com/maester365/maester/blob/main/tests/ad/domain-controller/Test.AD-DCD-01.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:nTDSDSA:ReadProperty |

</details>

## Source

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