From 1ac1f83abd2da914eae90644fc6e627d0f13158f Mon Sep 17 00:00:00 2001 From: Przemyslaw Klys Date: Sun, 7 Feb 2021 10:06:11 +0100 Subject: [PATCH] Fix #9 --- Public/Get-GPOZaurrNetlogon.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Public/Get-GPOZaurrNetlogon.ps1 b/Public/Get-GPOZaurrNetlogon.ps1 index 21d8f1f..437d188 100644 --- a/Public/Get-GPOZaurrNetlogon.ps1 +++ b/Public/Get-GPOZaurrNetlogon.ps1 @@ -26,13 +26,13 @@ } catch { Write-Warning "Get-GPOZaurrNetLogon - ACL reading failed for $($File.FullName) with error $($_.Exception.Message) ($($_.CategoryInfo.Reason))" } - #if ($ACL.Owner) { - $IdentityOwner = Convert-Identity -Identity $ACL.Owner -Verbose:$false - $IdentityOwnerAdvanced = Get-WinADObject -Identity $ACL.Owner -Cache -Verbose:$false - #} else { - # $IdentityOwner = [PSCustomObject] @{ SID = ''; Type = 'Unknown' } - # $IdentityOwnerAdvanced = [PSCustomObject] @{ ObjectClass = '' } - #} + if ($ACL.Owner) { + $IdentityOwner = Convert-Identity -Identity $ACL.Owner -Verbose:$false + $IdentityOwnerAdvanced = Get-WinADObject -Identity $ACL.Owner -Cache -Verbose:$false + } else { + $IdentityOwner = [PSCustomObject] @{ Name = ''; SID = ''; Type = 'Unknown' } + $IdentityOwnerAdvanced = [PSCustomObject] @{ ObjectClass = '' } + } if (-not $OwnerOnly) { if (-not $SkipOwner) { if ($IdentityOwner.SID -eq "S-1-5-32-544") {