If you are still interested I wrote an NT/2K command file (batch file) that calls a VBScript to do what you need, I have this set up on both my old MF 1.8 boxes and my XP boxes to kick users off at a specific time so I can run nightly processing. the command file loks like this
FOR /F "skip=1 tokens=3,4" %%h IN ('quser') DO IF "%%i"=="disc" RESET SESSION %%h
quser>quser.txt
cscript nghtutilusrs.vbs
FOR /F "tokens=3,4" %%h IN (results.txt) DO LOGOFF %%h
The first two lines are really one but got wrapped when I pasted them in.
The first thing it does is reset any disconnected sessions then does a QUSER to an output file.
This file is used as input to a VBScript that strips out certain user ID and puts the rest of the data into another file (results.txt) which is then read and the users I want logged off are dropped.
Here is the VBS watchout for the wordwrap.
' NGHTUTILUSRS.VBS
' This script creates an output file of users still logged into a Citrix server.
' The output file is used by the FOR command to logoff these users
' The colling command file first runs the FOR command against a memory file created
' by the QUSER command to reset any disconnected sessions.
' FOR /F "skip=1 tokens=3,4" %%h IN ('quser') DO IF "%%i"=="disc" RESET SESSION %%h
' The calling command file then runs the QUSER command to a text file called QUSER.TXT
' which is then used as input for this script.
' QUSER>QUSER.TXT
'
' Define Variables
DIM objFSO
DIM strLoggedOnUsers
DIM compString
DIM compVal
'
' Create a File System Object so we can manuipulate the files.
Set objFSO = CreateObject("Scripting.FileSystemObject")
'
' Open the input file (QUSER.TXT) in read-only mode
Set objInputFile = objFSO.OpenTextFile("quser.txt",1)
'
' Create and open the output file (results.txt) in read-write mode
Set objOutputFile = objFSO.OpenTextFile("results.txt", 2, True)
'
' Skip the first line of the input file
objInputfile.SkipLine
'
' Read the rest of the input file
Do Until objInputFile.AtEndOfStream
'
' Read a line of data from the input file and put in the variable
strLoggedOnUsers = objInputFile.Readline
'
' Extract the 4th through 8th characters from the input data
compString = Mid(strLoggedOnUsers,4,5)
'
' Compare the extracted data to the constant "night"
compVal = StrComp(compString, "night", 1)
'
' If the compared strings do not match write the input data to the output file
if compVal <> 0 then
objOutputFile.WriteLine(strLoggedOnUsers)
end if
' go back to the begining and get the next line of input data
Loop
'
' After reading and processing the input file close both the input and output files
'
objInputFile.Close
objOutputFile.Close
'
' After the output file is created (RESULTS.TXT) it is used by the FOR command to
' gracefully logoff users and close any open files.
' FOR /F "tokens=3,4" %%h IN (results.txt) DO LOGOFF %%i