Bug fix in Find-GPOLocation

This commit is contained in:
Harmj0y
2016-03-18 06:13:05 -04:00
parent 26a0757612
commit 37389e9658
+9 -5
View File
@@ -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