I am trying to write a batch file that will logoff Citrix (Terminal Services) connections.
The username will be passed to the batch file from an external application. I need to use this to logoff the session from the batch file.
Code: Select all
logoff username /Server:server1
Is there a way I can use QWINSTA (or similar), and assign the ID into a variable? This way I can run my logoff command.
Example:
Code: Select all
qwinsta USERNAME /SERVER:citrixserver
SESSIONNAME USERNAME ID STATE TYPE DEVICE
ica-tcp#6534 UserOne 3 Active wdica
The code should store "3" in a variable.
Any suggestions welcome.
Thank you.