Hi Experts. I just worked with an expert to get this script running now I want to tweak it some. The script essentially runs through a text file containing the 200+ computers in my domain and writes to the log file the user that is logged in. The problem I have noticed is that the script will wait a few seconds on a pc that isn't online. So I was hoping I could build in a portion of the script that will ping the machine (or do whatever to verify if it is online or not) and if the pc is on, grab the current user, if not, skip it and go to the next one.
I have zero idea on how to do this so please be willing to answer noob questions. Thanks in advance.
for /F %%c in (C:\tools\computers.txt) do (
C:\tools\psloggedon -l -x \\%comp% >> C:\tools\Logged_On.txt