# Group AdminCount should be retrievable

The AdminCount attribute is a critical Active Directory security marker that indicates a group is considered "protected" by the system.

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

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

## Overview

The AdminCount attribute is a critical Active Directory security marker that indicates a group is considered "protected" by the system. Groups with AdminCount set receive special security protections that prevent delegation of administrative privileges through inheritance. This test helps identify:

- **Privileged groups**: Groups that are members of protected groups like Domain Admins, Enterprise Admins, or Schema Admins
- **Security inheritance issues**: Groups that may have broken inheritance due to AdminCount settings
- **Audit targets**: Groups requiring enhanced monitoring due to their administrative nature
- **Delegation challenges**: Groups that cannot receive permissions through normal inheritance

#### Control Type

**Detective**

#### Security Recommendation

- Review all groups with AdminCount set to ensure they still require elevated privileges
- Remove groups from protected groups if they no longer need administrative access
- Be aware that removing a group from a protected group does not automatically clear the AdminCount attribute
- Manually clear AdminCount for groups that should no longer be protected
- Monitor changes to AdminCount attributes as they indicate privilege escalation

#### How the Test Works

This test retrieves all group objects from Active Directory and counts:
- Total number of groups
- Number of groups with AdminCount attribute set (non-null and greater than 0)
- Percentage of groups with AdminCount

#### Related Tests

- `Test-MtAdGroupWithManagerCount` - Identifies groups with delegated management
- `Test-MtAdGroupSidHistoryCount` - Finds groups migrated from other domains

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-GRP-01 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Groups |
| Area | Privileged access |
| Resource type | Group |
| MITRE ATT&CK | None |
| PowerShell test | [Test-MtAdGroupAdminCount](https://github.com/maester365/maester/blob/main/tests/ad/group/Test.AD-GRP-01.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:group:ReadProperty |

</details>

## Source

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