2

Somebody could provide me a tip on how could I make a script file (.cmd) which logs off the current user AND all other open sessions with same username?

E.g.: I'm logged into three TS sessions with username "JOHN". I wish to run a script (from my current session, without administrative privileges) which would logoff my current session and also the other two.

Ideas?

3 Answers3

1

You should read this page. It has the full command line syntax for Terminal services

http://technet.microsoft.com/en-us/library/cc775998%28WS.10%29.aspx

Stewart Robinson
  • 1,155
  • 4
  • 12
  • 24
0

Download TSLogoff from http://www.ctrl-alt-del.com.au/CAD_Utils.htm and run

tslogoff username /server:*

0

Just type logoff /? in your command prompt for the syntax. Than you can at least loff of your current session.

I think you need to have local admin permissions to log someone else off. Not sure how it is for another session from you. You can try if the task manager is enough for you (just hit CTRL+ALT+End and you get the Ctrl+ALT+DEL menu for your remote system; choose Task Manager). The task manager has a users tab that you can use to kick users out. It definitely works if you are a local admin. Be careful you can also kick your current session. ;)

Peter Schuetze
  • 1,241
  • 10
  • 17
  • Thanks! But unfortunately, this would logoff only the CURRENT session. Not the other two. BTW: It should not require administrative privileges simply because it is not someone else. It's me. Same credentials. –  Dec 23 '09 at 19:45
  • Logoff also takes a session ID. or session name. So you should be able to kick other people off. With task manager you can kick off everyone (if you are an admin). – Peter Schuetze Dec 23 '09 at 19:51