mirror of
https://github.com/PowerShellMafia/PowerSploit
synced 2026-06-08 12:13:33 +00:00
Bug fix in Find-GPOLocation
This commit is contained in:
+9
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user