server = "MyServer"
Set ws = CreateObject("WScript.Shell")
Set oExec = ws.Exec("quser /server:" & server)
Do
WScript.Sleep 10
Loop Until oExec.Status = 1
Do Until oExec.stdOut.atEndOfStream
'insert code here to evaluate output
'oExec.StdOut.readLine will allow you to access the output
'one line at a time
Loop
|