kevinward13 Posted August 19, 2011 Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now