diff options
author | Harmj0y <will@harmj0y.net> | 2016-03-18 06:13:05 -0400 |
---|---|---|
committer | Harmj0y <will@harmj0y.net> | 2016-03-18 06:13:05 -0400 |
commit | 37389e965895b1f478fef8f65ad9699705c191a7 (patch) | |
tree | 9fe9ed1565585ee5a6a98a52b4e86e0d72cee49c /Recon | |
parent | 26a0757612e5654b4f792b012ab8f10f95d391c9 (diff) | |
download | PowerSploit-37389e965895b1f478fef8f65ad9699705c191a7.tar.gz PowerSploit-37389e965895b1f478fef8f65ad9699705c191a7.zip |
Bug fix in Find-GPOLocation
Diffstat (limited to 'Recon')
-rw-r--r-- | Recon/PowerView.ps1 | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Recon/PowerView.ps1 b/Recon/PowerView.ps1 index 80a1a9f..e6f6233 100644 --- a/Recon/PowerView.ps1 +++ b/Recon/PowerView.ps1 @@ -5746,6 +5746,10 @@ function Get-NetGPO { The GPO display name to query for, wildcards accepted. + .PARAMETER ComputerName + + Return all GPO objects applied to a given computer (FQDN). + .PARAMETER Domain The domain to query for GPOs, defaults to the current domain. @@ -6469,6 +6473,11 @@ function Find-GPOLocation { $GPOguid = $_.GPOName $GPOMembers = $_.Members + if(!$TargetObjects) { + # if the * wildcard was used, set the ObjectDistName as the GPO member sid set + $TargetObjects = $GPOMembers + } + if( -not $ProcessedGUIDs[$GPOguid] ) { $GPOname = $_.GPODisplayName $Filters = $_.Filters @@ -6487,11 +6496,6 @@ function Find-GPOLocation { $OUComputers = Get-NetComputer -Domain $Domain -DomainController $DomainController -Credential $Credential -ADSpath $_.ADSpath -PageSize $PageSize } - if(!$TargetObjects) { - # if the * wildcard was used, set the ObjectDistName as the GPO member sid set - $TargetObjects = $GPOMembers - } - ForEach ($TargetSid in $TargetObjects) { $Object = Get-ADObject -SID $TargetSid -Domain $Domain -DomainController $DomainController $_ -PageSize $PageSize |