Skip to content

Commit

Permalink
attempted fix for issue #20
Browse files Browse the repository at this point in the history
  • Loading branch information
HarmJ0y committed Aug 10, 2016
1 parent ab172ca commit 69f4915
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions PowerShell/BloodHound.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit 69f4915

Please sign in to comment.