Project

GPOZaurr

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

Stars 1,250
Forks 119
Open issues 15
PowerShell Gallery downloads 421,558
Release v1.1.11
Language: PowerShell Updated: 2026-10-09
Command

Remove-GPOZaurrBroken

Module GPOZaurr

Finds and removes broken Group Policies from SYSVOL or AD or both.

Syntax

Remove-GPOZaurrBroken [-BackupDated] [-BackupPath <String>] [-ExcludeDomains <String[]>] [-ExtendedForestInformation <IDictionary>] [-Forest <String>] [-IncludeDomains <String[]>] [-LimitProcessing <Int32>] [-Type] <SYSVOL|AD|ObjectClass> [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Finds and removes broken Group Policies from SYSVOL or AD or both. Assesment is based on Get-GPOZaurrBroken and there are 3 supported types: - AD - meaning GPOs which have no SYSVOL content will be deleted from AD - SYSVOL - meaning GPOs which have no AD content will be deleted from SYSVOL - ObjectClass - meaning GPOs which have ObjectClass category of Container rather than groupPolicyContainer will be deleted from AD & SYSVOL

Examples

Authored help example

EXAMPLE 1

Remove-GPOZaurrBroken -Verbose -WhatIf -Type AD, SYSVOL

EXAMPLE 2

Remove-GPOZaurrBroken -Verbose -WhatIf -Type AD, SYSVOL -IncludeDomains 'ad.evotec.pl' -LimitProcessing 2

EXAMPLE 3

Remove-GPOZaurrBroken -Verbose -IncludeDomains 'ad.evotec.xyz' -BackupPath $Env:UserProfile\Desktop\MyBackup1 -WhatIf -Type AD, SYSVOL

Parameters

-BackupDated SwitchParameter optional
Forces backup to be created within folder that has date in it
-BackupPath String optional
Path to optional backup of SYSVOL content before deletion
-ExcludeDomains String[] optional
Exclude domain from search, by default whole forest is scanned
-ExtendedForestInformation IDictionary optional
Ability to provide Forest Information from another command to speed up processing
-Forest String optionalaliases: ForestName
Target different Forest, by default current forest is used
-IncludeDomains String[] optionalaliases: Domain, Domains
Include only specific domains, by default whole forest is scanned
-LimitProcessing Int32 optional
Allows to specify maximum number of items that will be fixed in a single run. It doesn't affect amount of GPOs processed
-Type String[] requiredposition: 0
Choose one or more types to delete. Options are AD, ObjectClass, SYSVOL
Possible values: SYSVOL, AD, ObjectClass

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.