From 673927b2b1211e34276a6d9493e1f74282b78fdb Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Sun, 22 Nov 2020 22:28:05 +0100 Subject: [PATCH] Update Remove-GPOZaurrDuplicateObject --- Public/Remove-GPOZaurrDuplicateObject.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)" }