# Enforced GPO link count should be retrievable

Enforced Group Policy Object (GPO) links are special link entries that block inheritance from being overridden at lower levels (for example, by child OUs).

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

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

## Overview

Enforced Group Policy Object (GPO) links are special link entries that **block inheritance** from being overridden at lower levels (for example, by child OUs).

This can be a powerful mechanism for security baselines, but it also increases the chance that a critical policy unintentionally becomes “sticky” across the domain.

#### Control Type

**Detective**

#### Security Recommendation

- **Enforced GPOs override inheritance blocking**: any configuration enforced at a higher scope can still apply even if child OUs attempt to disable inheritance.
- **Use enforced links sparingly**: reserve them for critical security policies that must apply everywhere.
- **Review enforced policies regularly**: confirm the GPO’s purpose and ownership, and ensure the enforced settings remain aligned with current security requirements.

#### How the Test Works

This test retrieves Active Directory GPO state from `Get-MtADGpoState` (using `$gpoState.GPOLinks`) and:

1. Examines each collected link object for the `Enforced` property.
2. Counts link entries where `Enforced` is `$true`.
3. Reports the enforced link count and the enforced ratio in Markdown.

#### Related Tests

- `Test-MtAdGpoTotalCount` - Counts total GPO inventory
- `Test-MtAdGpoLinkedCount` - Identifies GPOs that are actively linked
- `Test-MtAdGpoUnlinkedCount` - Identifies GPOs not linked anywhere
- `Test-MtAdGpoUnlinkedDetails` - Shows unlinked GPO details

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-GPOL-04 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Group Policy |
| Area | Infrastructure hardening |
| Resource type | GroupPolicy |
| MITRE ATT&CK | None |
| PowerShell test | [Test-MtAdGpoEnforcedCount](https://github.com/maester365/maester/blob/main/tests/ad/gpo/Test.AD-GPOL-04.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:groupPolicyContainer.gPCFileSysPath:ReadProperty, ActiveDirectory:File:SYSVOL:Read |

</details>

## Source

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