- 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.
3.7 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-GPOZaurrLegacyFiles
SYNOPSIS
Removes legacy Group Policy Objects (GPO) files from specified domains.
SYNTAX
__AllParameterSets
Remove-GPOZaurrLegacyFiles [[-BackupPath] <string>] [[-Forest] <string>] [[-ExcludeDomains] <string[]>] [[-IncludeDomains] <string[]>] [[-LimitProcessing] <int>] [-BackupDated] [-RemoveEmptyFolders] [-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
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
PS > 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
Indicates whether backup files should be timestamped with the current date and time.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases:
Possible values:
Required: False
Position: named
Default value: False
Accept pipeline input: False
Accept wildcard characters: True
-BackupPath
Specifies the path where backup files will be stored.
Type: String
Parameter Sets: __AllParameterSets
Aliases:
Possible values:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
-ExcludeDomains
Specifies an array of domains to exclude from processing.
Type: String[]
Parameter Sets: __AllParameterSets
Aliases:
Possible values:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
-Forest
Specifies the forest where the GPO files are located.
Type: String
Parameter Sets: __AllParameterSets
Aliases: ForestName
Possible values:
Required: False
Position: 1
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: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
-LimitProcessing
Specifies the maximum number of GPO files to process.
Type: Int32
Parameter Sets: __AllParameterSets
Aliases:
Possible values:
Required: False
Position: 4
Default value: 2147483647
Accept pipeline input: False
Accept wildcard characters: True
-RemoveEmptyFolders
Indicates whether empty folders should be removed after GPO files are deleted.
Type: SwitchParameter
Parameter Sets: __AllParameterSets
Aliases:
Possible values:
Required: False
Position: named
Default value: False
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
RELATED LINKS
- None