# Remove-GPOZaurrLinkEmptyOU

Removes Group Policy Object (GPO) links from empty Organizational Units (OUs) in a specified forest.

Project

GPOZaurr

GPOZaurr helps inspect, report on, and remediate Group Policy environments with PowerShell.

[View on GitHub](https://github.com/EvotecIT/GPOZaurr) [Visit Website](#) [Releases](https://github.com/EvotecIT/GPOZaurr/releases/tag/v1.1.10) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/GPOZaurr/1.1.9)

Stars **1,257**

Forks **121**

Open issues **15**

PowerShell Gallery downloads **421,558**

Release **v1.1.11**

Language: PowerShell Updated: 2026-10-30

Command 

**Module**

`GPOZaurr`

Removes Group Policy Object (GPO) links from empty Organizational Units (OUs) in a specified forest.

## Syntax

```
Remove-GPOZaurrLinkEmptyOU
[[-ExcludeDomains] <String[]>]
[[-ExcludeOrganizationalUnit] <String[]>]
[[-ExtendedForestInformation] <IDictionary>]
[[-Forest] <String>]
[[-IncludeDomains] <String[]>]
[[-LimitProcessing] <Int32>]
[<CommonParameters>]
```

[#](#method-remove-gpozaurrlinkemptyou-string-string-idictionary-string-string-int32)

Parameter set: `All Parameter Sets`

## Description

This function removes GPO links from OUs that are empty and meet specified criteria. It processes OUs within the specified forest based on inclusion and exclusion rules.

## Examples

### Example 1

```powershell
Remove-GPOZaurrLinkEmptyOU -Forest "ContosoForest" -IncludeDomains @("domain1", "domain2") -ExcludeDomains @("domain3") -ExtendedForestInformation $info -ExcludeOrganizationalUnit @("OU=TestOU,DC=contoso,DC=com") -LimitProcessing 100
Removes GPO links from empty OUs in the "ContosoForest" forest, including domains "domain1" and "domain2" but excluding "domain3". Additional forest information is provided, and processing is limited to 100 OUs.
```

## Parameters

**-ExcludeDomains String[] optionalposition: 1**

Specifies an array of domains to exclude from processing.

**-ExcludeOrganizationalUnit String[] optionalposition: 4**

Specifies an array of OUs to exclude from processing.

**-ExtendedForestInformation IDictionary optionalposition: 3**

Specifies additional information about the forest.

**-Forest String optionalposition: 0aliases: ForestName**

Specifies the name of the forest to target for processing.

**-IncludeDomains String[] optionalposition: 2aliases: Domain, Domains**

Specifies an array of domains to include for processing.

**-LimitProcessing Int32 optionalposition: 5**

Specifies the maximum number of OUs to process.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:02CA71DEF1D8BB38411AB96A6DEAF0B4EF12529C7281C97F9659669DC625D2C5 -->
