From a87453eeca0b6f9c90b4d359d5848270c3ec29f5 Mon Sep 17 00:00:00 2001 From: Harmj0y Date: Mon, 7 Mar 2016 02:53:30 -0500 Subject: DomainOnly tweak --- Recon/PowerView.ps1 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Recon') diff --git a/Recon/PowerView.ps1 b/Recon/PowerView.ps1 index e657c5d..d7b6483 100644 --- a/Recon/PowerView.ps1 +++ b/Recon/PowerView.ps1 @@ -11138,12 +11138,11 @@ function Invoke-EnumerateLocalAdmin { $LocalAdmins = $LocalAdmins | Where-Object { ($TrustGroupsSIDs -contains $_.SID) -or ((-not $_.SID.startsWith($LocalSID)) -and (-not $_.SID.startsWith($DomainSID))) } } - if($LocalAdmins -and ($LocalAdmins.Length -ne 0)) { - - if($DomainOnly) { - $LocalAdmins = $LocalAdmins | Where-Object {$_.IsDomain} - } + if($DomainOnly) { + $LocalAdmins = $LocalAdmins | Where-Object {$_.IsDomain} + } + if($LocalAdmins -and ($LocalAdmins.Length -ne 0)) { # output the results to a csv if specified if($OutFile) { $LocalAdmins | Export-PowerViewCSV -OutFile $OutFile -- cgit v1.2.3