Command
Remove-GPOZaurrLegacyFiles
Removes legacy Group Policy Objects (GPO) files from specified domains.
Syntax
Remove-GPOZaurrLegacyFiles [-BackupDated] [[-BackupPath] <String>] [[-ExcludeDomains] <String[]>] [[-Forest] <String>] [[-IncludeDomains] <String[]>] [[-LimitProcessing] <Int32>] [-RemoveEmptyFolders] [<CommonParameters>]#Parameter set:
All Parameter SetsDescription
The Remove-GPOZaurrLegacyFiles function removes legacy GPO files from specified domains. It can back up the files before removal and optionally remove empty folders.
Examples
EXAMPLE 1
Remove-GPOZaurrLegacyFiles -BackupPath "C:\GPOBackups" -BackupDated -RemoveEmptyFolders -Forest "Contoso" -IncludeDomains "Domain1", "Domain2" -ExcludeDomains "Domain3" -LimitProcessing 100
Removes legacy GPO files from the "Contoso" forest for "Domain1" and "Domain2", excluding "Domain3". Backs up files to "C:\GPOBackups" with timestamps and removes empty folders after deletion.Parameters
- -BackupDated SwitchParameter
- Indicates whether backup files should be timestamped with the current date and time.
- -BackupPath String
- Specifies the path where backup files will be stored.
- -ExcludeDomains String[]
- Specifies an array of domains to exclude from processing.
- -Forest String
- Specifies the forest where the GPO files are located.
- -IncludeDomains String[]
- Specifies an array of domains to include for processing.
- -LimitProcessing Int32
- Specifies the maximum number of GPO files to process.
- -RemoveEmptyFolders SwitchParameter
- Indicates whether empty folders should be removed after GPO files are deleted.
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.