Test If a PC is Logged in Over a Network
Is there any way using Perl, PS Tools, or Autoit, to test a PC, over my network, to see if it is powered on and logged in?
- Script begins
- Script tests pc to see if it is powered on and logged in as a user
- Script runs a task on that pc
- Return 0 if the pc is not logged in and/or powered off
- Return the user name of who ever is logged in.
TASKLIST /S hostname /U username TASKLIST /S hostname /U domain\username
will show you all the tasks that a user is running on a machine. If it returns an error or no output, then the user is not logged on. Otherwise, you parse the program list and decide for yourself whether the programs indicate that the user is logged on, or there are just some tasks running in the background on his/her behalf.