Files
GPOZaurr/Docs/Remove-GPOZaurrLinkEmptyOU.md
T
Przemysław Kłys f7bdaca724 docs: ✏️ Update documentation for GPOZaurr module
- Revised `Set-GPOZaurrOwner.md` to enhance clarity and detail for parameters and examples.
- Updated `Set-GPOZaurrStatus.md` with a new online version link and improved structure.
- Refined `Skip-GroupPolicy.md` to clarify usage within script blocks and added examples.
- Adjusted `GPOZaurr.psd1` for version updates and improved module dependencies.
- Enhanced `GPOZaurr.psm1` for better error handling during function imports.
- Modified `Invoke-GPOZaurrSupport.ps1` examples to use `Join-Path` for path construction.
2026-05-19 18:47:50 +02:00

3.5 KiB

external help file, Module Name, online version, schema
external help file Module Name online version schema
GPOZaurr-help.xml GPOZaurr https://github.com/EvotecIT/GPOZaurr 2.0.0

Remove-GPOZaurrLinkEmptyOU

SYNOPSIS

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

SYNTAX

__AllParameterSets

Remove-GPOZaurrLinkEmptyOU [[-Forest] <string>] [[-ExcludeDomains] <string[]>] [[-IncludeDomains] <string[]>] [[-ExtendedForestInformation] <IDictionary>] [[-ExcludeOrganizationalUnit] <string[]>] [[-LimitProcessing] <int>] [-WhatIf] [-Confirm] [<CommonParameters>]

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

PS > 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

Specifies an array of domains to exclude from processing.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: 
Possible values: 

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ExcludeOrganizationalUnit

Specifies an array of OUs to exclude from processing.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: 
Possible values: 

Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ExtendedForestInformation

Specifies additional information about the forest.

Type: IDictionary
Parameter Sets: __AllParameterSets
Aliases: 
Possible values: 

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-Forest

Specifies the name of the forest to target for processing.

Type: String
Parameter Sets: __AllParameterSets
Aliases: ForestName
Possible values: 

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-IncludeDomains

Specifies an array of domains to include for processing.

Type: String[]
Parameter Sets: __AllParameterSets
Aliases: Domain, Domains
Possible values: 

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-LimitProcessing

Specifies the maximum number of OUs to process.

Type: Int32
Parameter Sets: __AllParameterSets
Aliases: 
Possible values: 

Required: False
Position: 5
Default value: 2147483647
Accept pipeline input: False
Accept wildcard characters: True

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

  • None

OUTPUTS

  • None
  • None