kevinward13 0 Posted August 19, 2011 (edited) 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 August 19, 2011 by kevinward13 Share this post Link to post Share on other sites