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

Module GPOZaurr

Removes specified GPOZaurr folders and backs them up to a specified path.

Syntax

Remove-GPOZaurrFolders [-BackupDated] [[-BackupPath] <String>] [[-ExcludeDomains] <String[]>] [[-ExtendedForestInformation] <IDictionary>] [[-FolderName] <String[]>] [-FolderType] <NTFRS|Empty> [[-Forest] <String>] [[-IncludeDomains] <String[]>] [[-LimitProcessing] <Int32>] [[-Type] <All|Netlogon|Sysvol>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

This function removes specified GPOZaurr folders based on the provided criteria and backs them up to a specified path. It allows for filtering by folder type, domain, and other parameters.

Examples

Authored help example

EXAMPLE 1

Remove-GPOZaurrFolders -BackupPath "C:\Backups" -BackupDated -Type 'All' -FolderType 'NTFRS' -FolderName "Folder1" -LimitProcessing 10 -Forest "ExampleForest" -ExcludeDomains "Domain1" -IncludeDomains "Domain2" -ExtendedForestInformation $info
Removes GPOZaurr folders of type 'NTFRS' named "Folder1" from all domains in the forest "ExampleForest", backs them up to "C:\Backups" with a timestamp, and limits processing to 10 folders.

Parameters

-BackupDated SwitchParameter optional
Indicates whether the backup path should include a timestamp.
-BackupPath String optionalposition: 0
The path where the GPOZaurr folders will be backed up.
-ExcludeDomains String[] optionalposition: 6
Specifies domains to exclude from processing.
-ExtendedForestInformation IDictionary optionalposition: 8
Specifies additional forest information.
-FolderName String[] optionalposition: 3
Specifies the name of the folder to remove.
-FolderType String requiredposition: 2
Specifies the type of folders to remove. Options are 'NTFRS' or 'Empty'.
Possible values: NTFRS, Empty
-Forest String optionalposition: 5aliases: ForestName
Specifies the forest to target.
-IncludeDomains String[] optionalposition: 7aliases: Domain, Domains
Specifies domains to include in processing.
-LimitProcessing Int32 optionalposition: 4
Limits the number of folders to process.
-Type String[] optionalposition: 1
Specifies the type of folders to remove. Options are 'All', 'Netlogon', or 'Sysvol'.
Possible values: All, Netlogon, Sysvol

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.