diff --git a/Public/Remove-GPOZaurrDuplicateObject.ps1 b/Public/Remove-GPOZaurrDuplicateObject.ps1 index 3085583..2933509 100644 --- a/Public/Remove-GPOZaurrDuplicateObject.ps1 +++ b/Public/Remove-GPOZaurrDuplicateObject.ps1 @@ -7,7 +7,6 @@ [alias('Domain', 'Domains')][string[]] $IncludeDomains, [System.Collections.IDictionary] $ExtendedForestInformation ) - $getGPOZaurrDuplicateObjectSplat = @{ Forest = $Forest IncludeDomains = $IncludeDomains @@ -18,7 +17,7 @@ $DuplicateGpoObjects = Get-GPOZaurrDuplicateObject @getGPOZaurrDuplicateObjectSplat foreach ($Duplicate in $DuplicateGpoObjects | Select-Object -First $LimitProcessing) { try { - Remove-ADObject -Identity $Duplicate.ObjectGUID -Recursive -ErrorAction Stop -Server $Duplicate.DomainName + Remove-ADObject -Identity $Duplicate.ObjectGUID -Recursive -ErrorAction Stop -Server $Duplicate.DomainName -Confirm:$false } catch { Write-Warning "Remove-GPOZaurrDuplicateObject - Deleting $($Duplicate.ConflictDN) / $($Duplicate.DomainName) via GUID: $($Duplicate.ObjectGUID) failed with error: $($_.Exception.Message)" }