From b9f85986ea7db9ebac8c994fe83a256bb9f85497 Mon Sep 17 00:00:00 2001 From: Keith Twombley Date: Wed, 10 Aug 2016 17:33:10 -0500 Subject: [PATCH] Fix for #24 after we have added PropertiesToLoad to $GroupSearcher once, subsequent calls to FindOne() will fail when trying to find the next group. If we still have a $Result, and that $Result contains a property named `member`, the loop will continue using the previous successful search results as though they are the current search results, resulting in reprocessing the previous group. --- PowerShell/BloodHound.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PowerShell/BloodHound.ps1 b/PowerShell/BloodHound.ps1 index 342f5984a..a1fe5345d 100644 --- a/PowerShell/BloodHound.ps1 +++ b/PowerShell/BloodHound.ps1 @@ -5421,6 +5421,8 @@ function Get-NetGroupMember { } $Members = @() + $GroupSearcher.PropertiesToLoad.Clear() + $Result = $False try { $Result = $GroupSearcher.FindOne() }