Tuesday, August 30, 2011

How to Logoff Users on a Remote Server from the CLI

This is some thing that can only be achieved through privileged access to the server you login to perform the task.

To Query for users on the Server

>QUSER [username | sessionname | sessionid] [/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER]

  • username: Identifies the session with user username.
  • sessionname: Identifies the session named sessionname.
  • sessionid: Identifies the session with ID sessionid.
  • /SERVER:servername: The server to be queried (default: current).
  • /MODE: Display current line settings.
  • /FLOW: Display current flow control settings.
  • /CONNECT: Display current connect settings.
  • /COUNTER: Display current TSs counters information.

This command will work for almost all the new Windows distributions. For windows XP, an Enviromental Variable needs to be added. However the path could be temporarily set by the below, before executing the above command.

>SET PATH = C:\Windows\System32\DLLCache

To Logoff a user from the server

>LOGOFF [sessionname | sessionid] [/SERVER:servername] [/V]

  • sessionname: The name of the session.
  • sessionid: The ID of the session.
  • /SERVER:servername: Specifies the TS (default is current).
  • /V: Displays info about the actions performed.

No comments:

Post a Comment