Tuesday, 6 March 2012

How to log off remote desktop users from a remote machine ?

When you try to log on to a  remote server on emergency to perform some task , it may throw an error "The terminal server has exceeded the maximum number of allowed connection". In many servers you may not have the rights to log on with /console or /admin option. I have faced this issue many times and the only option is to get the help from infrastructure team to log off users from the server.

I was searching for a solution for this and found  an option to log off the remote desktop users from  another machine (in the same domain) through command line. The first step to achieve is to list the current  log on session on the remote computer. For that we can use following command from the command prompt. Replace the with your server IP address.

C:\>quser /SERVER:

This will list the current log on session. Please find below screenshot. I have removed the IP address and log in name from the screenshot. You can see the session ID 0,1 and 2 for three available sessions. This is the ID which we will be using in our next step to log off user.

To log off session listed in the previous step, use the following command.Here I am trying to log off the session 0

C:\> logoff / 0 /V 

Now you will be able to do the remote desktop to the server.


  1. Thank you very much.

  2. Great! Thanks!

  3. Thank you, very helpful! :)

  4. How we can add a warning message for remote users before they loggoff?

    1. shutdown /I will open a GUI that allows for this.

  5. Thank you very much


  6. I loved the way you discuss the topic great work thanks for the share, Let me share this, Hadoop training in pune


  7. imo install
    imo beta
    imo messenger
    imo online
    I loved the way you discuss the topic great work thanks for the share.

  8. Gone through this wonderful coures called Salesforce Certification Training in Dallas who are offering fully practical course, who parent is Salesforce Training in USA and they have students at Salesforce Training classes in Canada institutes.