I am new to vbscript.
I am running a psloggedon.exe via a vbscript for a total of 25 computers. I need to check the line that says "Users logged on locally" and see if it says "Users logged on locally" or "No one is logged on locally".
If it says a user is logged in, i need to write that out to a text file along with the computer name. If it says no one is logged on, i need to write the computer name out to the same text file and say "available". I'd loop through and have a list of all 25 machines. I cant seem to figure out how to go to that one line and validate what it says.
PsLoggedon v1.34 - See who's logged on
Copyright (C) 2000-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Users logged on locally:
2/19/2014 8:56:35 AM DOMAIN\John.Smith
Users logged on via resource shares:
2/26/2014 10:09:07 AM DOMAIN\John.Smith
Code excerpt:
Dim ObjExec
Dim strFromProc
Dim MachineNum
MachineNum = 1
Set objShell = CreateObject("WScript.Shell")
Set ObjExec = objShell.Exec("cmd /K CD F:\QA & LabQwinsta")
Do
strFromProc = ObjExec.Stdout.Readall()
msgbox strFromProc
document.write(strFromProc)
Thats about as far ive gotten. At this point is just displays everyline in the text file.
PSLOGGEDON. - aphoria