# Stale groups count should be retrievable

Groups that have not been modified for an extended period (in this case, before 2020) may represent:

Source: https://maester.dev/docs/tests/AD-GRP-03

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

## Overview

Groups that have not been modified for an extended period (in this case, before 2020) may represent:

- **Abandoned groups**: Created for projects or purposes that no longer exist
- **Orphaned permissions**: Groups with memberships that haven't been reviewed
- **Security blind spots**: Groups that could be repurposed by attackers
- **Directory clutter**: Unused objects that complicate administration
- **Compliance issues**: Undocumented groups that auditors may question

Stale groups pose particular risks because:
- They may contain members who should have been removed
- They might grant access to resources that should be restricted
- Their purpose may be forgotten, making them difficult to audit

#### Control Type

**Detective**

#### Security Recommendation

- Establish a regular review process for groups that haven't been modified recently
- Document all groups and their purposes
- Consider implementing a group lifecycle policy with automatic expiration
- Remove groups that are no longer needed after confirming they're not referenced
- Update the modifyTimeStamp by reviewing group membership periodically

#### How the Test Works

This test retrieves all group objects from Active Directory and:
- Examines the modifyTimeStamp property of each group
- Counts groups where modifyTimeStamp is before January 1, 2020
- Calculates the percentage of stale groups in the environment

#### Related Tests

- `Test-MtAdGroupWithManagerCount` - Groups with managers are more likely to be actively maintained
- `Test-MtAdGroupSidHistoryCount` - Stale groups may be remnants of domain migrations

## Details

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

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

</details>

## Source

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