Skip to content

Commit

Permalink
Attempted fix for issue #17
Browse files Browse the repository at this point in the history
  • Loading branch information
HarmJ0y committed Aug 10, 2016
1 parent 69f4915 commit 54862e8
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions PowerShell/BloodHound.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7793,18 +7793,23 @@ function Get-NetLocalGroup {

# try to extract out the machine SID by using the -500 account as a reference
$MachineSid = $LocalUsers | Where-Object {$_.SID -like '*-500'}
$Parts = $MachineSid.SID.Split('-')
$MachineSid = $Parts[0..($Parts.Length -2)] -join '-'
try {
$Parts = $MachineSid.SID.Split('-')
$MachineSid = $Parts[0..($Parts.Length -2)] -join '-'

$LocalUsers | ForEach-Object {
if($_.SID -match $MachineSid) {
$_ | Add-Member Noteproperty 'IsDomain' $False
}
else {
$_ | Add-Member Noteproperty 'IsDomain' $True
$LocalUsers | ForEach-Object {
if($_.SID -match $MachineSid) {
$_ | Add-Member Noteproperty 'IsDomain' $False
}
else {
$_ | Add-Member Noteproperty 'IsDomain' $True
}
}
$LocalUsers
}
catch {
Write-Verbose "Error retrieving machine SID for $Server"
}
$LocalUsers
}
else {
Write-Verbose "Error: $(([ComponentModel.Win32Exception] $Result).Message)"
Expand Down

0 comments on commit 54862e8

Please sign in to comment.