Jump to content
Sign in to follow this  
kevinward13

[RESOLVED] Why isnt this working....

Recommended Posts

kevinward13

FileInstall('.\Include\Psexec.exe', @TempDir & '\')
FileInstall('.\Include\Psloggedon.exe', @TempDir & '\')


Global $Wname
Global $cUser
Global Const $PsExecReg = 'HKCU\Software\Sysinternals\PsExec'
Global Const $PsLoggReg = 'HKCU\Software\Sysinternals\PsLoggedon'
Global Const $PS = 'psexec.exe'
Global Const $PL = 'psloggedon.exe'

Global $TxtLog = "_LoggedOn.txt"
Global $TxtDir = "C:\temp\"
Global $CurrentLoggedOn, $Pid_CMD, $CountLines

If RegRead($PsExecReg, 'EulaAccepted') = '' Then RegWrite($PsExecReg, 'EulaAccepted', 'REG_DWORD', 1)
If RegRead($PsLoggReg, 'EulaAccepted') = '' Then RegWrite($PsLoggReg, 'EulaAccepted', 'REG_DWORD', 1)




$Wname = InputBox("Enter Workstation Name", "PC NAME:")

_Loggedon()

Func _Loggedon()

    $Pid_CMD = Run(@ComSpec & ' /k ' & $PL & ' \\' & $Wname & '| FIND "AD\" >> ' & $TxtDir & $Wname & $TxtLog)

    MsgBox(0, "Test", "CMD PID: " & $Pid_CMD)

Why is this part not giving me the currently logged on person for the remote PC?

Not sure if this is even the correct syntax.

Added this change

$Pid_CMD = Run(@ComSpec & ' /c ' & $PL & ' -l -x \\' & $Wname & '| FIND "AD\" >> ' & $TxtDir & $Wname & $TxtLog)
Edited by kevinward13

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×