How to Remotely Disconnect a User in Windows Server

How to Remotely Disconnect a User in Windows Server

Some Windows installations (like upgrading Windows Server 2008 R2 to Windows Server 2012) will not let you upgrade if there is a user logged on the machine.  Even if the user is disconnected, the upgrade will not take place.

Easy enough, you think, I only need to bring up the Task Manager, switch to Users and click Disconnect:

Disconnecting a user using Task Manager

Unfortunately, after selecting Log Off, I always get this error regardless of the fact that I am an administrator:


The only way I’ve managed to disconnect the user is using the command prompt.

First, type qwinsta to see the list of sessions:

This helps us find the ID of the user we want to disconnect

Now we simply issue the command rwinsta followed by the ID of the user:


For more info on connecting to remote sessions, please visit the source URL:

One response to “How to Remotely Disconnect a User in Windows Server”

  1. Rudi says:

    Thank you, thank you and 1000 times more, thank you

Leave a Reply

Your email address will not be published. Required fields are marked *