Well as it goes, the more you show the more they want... I am trying to write a script that will ask for the logged in users name, once entered in, the script will check all 10 of my terminal servers and if the user is found log them out (by using their session ID) My terminal server skill set it not where I would like it to be so any help would be great !!! Here is what I have so far.... I am using the Qwinsta.exe application to view the session information and do not yet have it checking against the user information or have the last part of the script to actually reset/logoff the user from the terminal servers. (Rwinsta)..
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("H:\inputlogs\termservers.txt", ForReading)
Set objshell = WScript.CreateObject ("WScript.Shell")
S0 = " /server:"
UserLogin = InputBox ("Type in the Users Login ID to log off from our terminal server farm")
Const ForReading = 1
Dim arrFileLines()
i = 0
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
'Then you can iterate it like this
For Each strLine In arrFileLines
objShell.Run "%comspec% /c qwinsta " & userlogin & S0 & Strline
WScript.Echo strLine
Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("H:\inputlogs\termservers.txt", ForReading)
Set objshell = WScript.CreateObject ("WScript.Shell")
S0 = " /server:"
UserLogin = InputBox ("Type in the Users Login ID to log off from our terminal server farm")
Const ForReading = 1
Dim arrFileLines()
i = 0
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
'Then you can iterate it like this
For Each strLine In arrFileLines
objShell.Run "%comspec% /c qwinsta " & userlogin & S0 & Strline
WScript.Echo strLine
Next