diff options
author | Harmj0y <will@harmj0y.net> | 2016-03-07 02:53:30 -0500 |
---|---|---|
committer | Harmj0y <will@harmj0y.net> | 2016-03-07 02:53:30 -0500 |
commit | a87453eeca0b6f9c90b4d359d5848270c3ec29f5 (patch) | |
tree | cf7a6ab5e3dc75245500b5f98db0792df047de4c /Recon/PowerView.ps1 | |
parent | c883dabf7780f5b8b3cc1bea1f9b163983174838 (diff) | |
download | PowerSploit-a87453eeca0b6f9c90b4d359d5848270c3ec29f5.tar.gz PowerSploit-a87453eeca0b6f9c90b4d359d5848270c3ec29f5.zip |
DomainOnly tweak
Diffstat (limited to 'Recon/PowerView.ps1')
-rw-r--r-- | Recon/PowerView.ps1 | 9 |
1 files changed, 4 insertions, 5 deletions
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 |