Skip to content

Commit 3049211

Browse files
committed
Fixed Find-LocalAdminAccess to properly check for the object output from Invoke-CheckLocalAdminAccess...whoops
1 parent cd1e10b commit 3049211

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Recon/PowerView.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8543,7 +8543,7 @@ filter Get-SiteName {
85438543
85448544
.EXAMPLE
85458545
8546-
PS C:\> Get-NetComputer | Invoke-CheckLocalAdminAccess
8546+
PS C:\> Get-NetComputer | Get-SiteName
85478547
85488548
Returns the sites for every machine in AD.
85498549
#>
@@ -9844,7 +9844,7 @@ function Invoke-UserHunter {
98449844
# see if we're checking to see if we have local admin access on this machine
98459845
if ($CheckAccess) {
98469846
$Admin = Invoke-CheckLocalAdminAccess -ComputerName $CName
9847-
$FoundUser | Add-Member Noteproperty 'LocalAdmin' $Admin
9847+
$FoundUser | Add-Member Noteproperty 'LocalAdmin' $Admin.IsAdmin
98489848
}
98499849
else {
98509850
$FoundUser | Add-Member Noteproperty 'LocalAdmin' $Null
@@ -9891,7 +9891,7 @@ function Invoke-UserHunter {
98919891
# see if we're checking to see if we have local admin access on this machine
98929892
if ($CheckAccess) {
98939893
$Admin = Invoke-CheckLocalAdminAccess -ComputerName $ComputerName
9894-
$FoundUser | Add-Member Noteproperty 'LocalAdmin' $Admin
9894+
$FoundUser | Add-Member Noteproperty 'LocalAdmin' $Admin.IsAdmin
98959895
}
98969896
else {
98979897
$FoundUser | Add-Member Noteproperty 'LocalAdmin' $Null
@@ -11743,7 +11743,7 @@ function Find-LocalAdminAccess {
1174311743
if($Up) {
1174411744
# check if the current user has local admin access to this server
1174511745
$Access = Invoke-CheckLocalAdminAccess -ComputerName $ComputerName
11746-
if ($Access) {
11746+
if ($Access.IsAdmin) {
1174711747
$ComputerName
1174811748
}
1174911749
}

0 commit comments

Comments
 (0)