# RIDs remaining should be retrievable

RIDs (Relative Identifiers) are essential for creating unique Security Identifiers (SIDs) for every user, group, and computer in Active Directory.

Source: https://maester.dev/docs/tests/AD-DOM-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 · Domain and forest · <a href="/docs/tests">All checks</a></p>

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

## Overview

RIDs (Relative Identifiers) are essential for creating unique Security Identifiers (SIDs) for every user, group, and computer in Active Directory. Each domain has a finite pool of approximately 1 billion RIDs:

 * **SID Exhaustion**: Running out of RIDs would prevent creation of any new security principals
 * **Business Impact**: New users, groups, or computers could not be created
 * **Recovery Complexity**: RID pool exhaustion requires complex forest recovery procedures

#### Control Type

**Operational**

#### Security Recommendation

Monitor RID consumption regularly:

 * **Normal Usage**: Most domains use only a small fraction of available RIDs over their lifetime
 * **High Consumption**: Rapid RID consumption may indicate:
  * Excessive computer account creation/deletion cycles
  * Automated provisioning scripts creating many accounts
  * Security issues like computer account flooding attacks
 * **Threshold Alerting**: Set alerts when RID usage exceeds 50% (very conservative) or 75%

If RID consumption is unexpectedly high:
1. Investigate the source of high account creation
2. Review computer join policies and scripts
3. Consider implementing stricter controls on account creation

#### How the Test Works

This test retrieves the RID available pool from Active Directory and calculates the remaining RIDs. The RID pool is a 64-bit value where the high 32 bits represent the total pool and the low 32 bits represent used RIDs.

#### Related Tests

- `Test-MtAdDomainControllerCount` - Counts domain controllers (RID masters)
- `Test-MtAdMachineAccountQuota` - Checks machine account creation limits

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-DOM-04 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Domain and forest |
| Area | Infrastructure hardening |
| Resource type | Tenant |
| MITRE ATT&CK | None |
| PowerShell test | [Test-MtAdRidsRemaining](https://github.com/maester365/maester/blob/main/tests/ad/domain/Test.AD-DOM-04.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:domainDNS.rIDAvailablePool:ReadProperty |

</details>

## Source

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