From 69f4915769f2944966a5c333712bf6250af8026d Mon Sep 17 00:00:00 2001 From: HarmJ0y Date: Wed, 10 Aug 2016 17:05:32 -0400 Subject: [PATCH] attempted fix for issue #20 --- PowerShell/BloodHound.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/PowerShell/BloodHound.ps1 b/PowerShell/BloodHound.ps1 index 865af7e4b..7cfca30ab 100644 --- a/PowerShell/BloodHound.ps1 +++ b/PowerShell/BloodHound.ps1 @@ -5420,17 +5420,23 @@ function Get-NetGroupMember { $GroupSearcher.filter = "(&(objectCategory=group)(objectSID=$SID)$Filter)" } + $Members = @() try { $Result = $GroupSearcher.FindOne() } catch { - $Members = @() + Write-Verbose "Error retrieving group searcher results: $_" } $GroupFoundName = '' - if ($Result) { - $Members = $Result.properties.item("member") + if ($Result -and $Result.properties) { + try { + $Members = $Result.properties.item("member") + } + catch { + Write-Verbose "Error retrieving members property." + } if($Members.count -eq 0) {