Update PowerView.ps1
Fixed null access control entry in results.
This commit is contained in:
parent
2501e8e912
commit
6a71a6e526
|
|
@ -18814,7 +18814,8 @@ function Get-GPODelegation
|
|||
$Searcher.SearchScope = "Subtree"
|
||||
$listGPO = $Searcher.FindAll()
|
||||
foreach ($gpo in $listGPO){
|
||||
$ACL = (([ADSI]$gpo.path).ObjectSecurity).Access | ? {$_.ActiveDirectoryRights -match "Write" -and $_.AccessControlType -eq "Allow" -and $Exclusions -notcontains $_.IdentityReference.toString().split("\")[1] -and $_.IdentityReference -ne "CREATOR OWNER"}
|
||||
$ACL = ([ADSI]$gpo.path).ObjectSecurity.Access | ? {$_.ActiveDirectoryRights -match "Write" -and $_.AccessControlType -eq "Allow" -and $Exclusions -notcontains $_.IdentityReference.toString().split("\")[1] -and $_.IdentityReference -ne "CREATOR OWNER"}
|
||||
if ($ACL -ne $null){
|
||||
$GpoACL = New-Object psobject
|
||||
$GpoACL | Add-Member Noteproperty 'ADSPath' $gpo.Properties.adspath
|
||||
$GpoACL | Add-Member Noteproperty 'GPODisplayName' $gpo.Properties.displayname
|
||||
|
|
@ -18824,6 +18825,7 @@ function Get-GPODelegation
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
########################################################
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue