This commit is contained in:
Przemyslaw Klys
2020-11-18 21:37:20 +01:00
parent 807ea420b0
commit 63ab1b571d
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -96,7 +96,7 @@
}
}
# Now we need to list thru Sysvol files and fine those that do not exists as GPO and create dummy GPO objects to show orphaned gpos
Write-Verbose "Get-GPOZaurrBroken - Processing SYSVOL differences and creating dummy objects"
Write-Verbose "Get-GPOZaurrBroken - Processing SYSVOL differences"
foreach ($_ in $Differences.Keys) {
if ($Differences[$_] -in 'Not available in AD', 'Permissions issue') {
$FullPath = $SysvolHash[$_].FullName
+2 -1
View File
@@ -35,7 +35,7 @@
} | Select-Object | Select-Object -First $LimitProcessing | ForEach-Object {
$GPO = $_
if ($GPO.Status -eq 'Not available in AD') {
Write-Verbose "Remove-GPOZaurrBroken - Processing $($GPO.Path)"
Write-Verbose "Remove-GPOZaurrBroken - Processing [AD] $($GPO.Path)"
if ($BackupFinalPath) {
Try {
Write-Verbose "Remove-GPOZaurrBroken - Backing up $($GPO.Path)"
@@ -55,6 +55,7 @@
}
}
} elseif ($GPO.Status -eq 'Not available on SYSVOL') {
Write-Verbose "Remove-GPOZaurrBroken - Processing [SYSVOL] $($GPO.DistinguishedName)"
try {
$ExistingObject = Get-ADObject -Identity $GPO.DistinguishedName -Server $GPO.DomainName -ErrorAction Stop
} catch {