Created
April 4, 2022 10:22
-
-
Save Purp1eW0lf/6ea822dfd0c452c8666d4dff54ab32f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stupid overengineered solution | |
$ErrorActionPreference= 'silentlycontinue'; | |
$value = gp "REGISTRY::HKEY_USERS\*\Software\Sysinternals\PsExec"; | |
$SID = $value.PsPath -split '\',4,'SimpleMatch' | select-string -pattern "S-" | % { $_.Line } | |
$NAME = gwmi win32_useraccount | ? SID -match $SID | select -expandproperty Name; | |
if ($value.EulaAccepted -eq 0){} else { write-host -NoNewline "`n Registry confirms PsExec used by "; write-host "$Name`n" -ForegroundColor magenta} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment