Remove-GPOZaurrBroken
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>]#All Parameter SetsDescription
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
EXAMPLE 1
Remove-GPOZaurrBroken -Verbose -WhatIf -Type AD, SYSVOLEXAMPLE 2
Remove-GPOZaurrBroken -Verbose -WhatIf -Type AD, SYSVOL -IncludeDomains 'ad.evotec.pl' -LimitProcessing 2EXAMPLE 3
Remove-GPOZaurrBroken -Verbose -IncludeDomains 'ad.evotec.xyz' -BackupPath $Env:UserProfile\Desktop\MyBackup1 -WhatIf -Type AD, SYSVOLParameters
- -BackupDated SwitchParameter
- Forces backup to be created within folder that has date in it
- -BackupPath String
- Path to optional backup of SYSVOL content before deletion
- -ExcludeDomains String[]
- Exclude domain from search, by default whole forest is scanned
- -ExtendedForestInformation IDictionary
- Ability to provide Forest Information from another command to speed up processing
- -Forest String
- Target different Forest, by default current forest is used
- -IncludeDomains String[]
- Include only specific domains, by default whole forest is scanned
- -LimitProcessing Int32
- 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[]
- 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.