By Ellie / Last Updated May 6, 2023

How to end a Remote Desktop session completely?

“I completed a Remote Desktop session between two computers on our network. I right-clicked the Close button at the top of the screen, where you can see the computer to which you are connected. But I’m curious if this just closes the screen of the remote computer on the computer you’re working on or if it completely logs off the remote computer?”


Three ways to log off the remote computer

It won't log off the remote computer if you just click the close icon when accessing a remote computer with Remote Desktop Connection. just To help you log off the remote computer instead of just closing the screen of the remote omputer, here we listed three tested methods.

Method 1. Sign out using Ctrl + Alt + End

The easiest to completely end a Remote Desktop session is to press Ctrl + Alt + End altogether on the remote computer. Then you’ll see the following screen show up. Click Sign out to log out of the remote desktop.

Remote Server Sign Out

Method 2. End a remote session using Session ID

Step 1. On the remote computer, right-click the Start menu in the bottom-left corner, and then click Command Prompt.

Command Prompt

Step 2. Type “query user” and hit Enter.

Query User

Step 3. Then you will see a list of users on the server. Find your user name in the list and note the session ID number. In the below example, my session ID is 291.

Remote Session ID

Step 4. Type “logoff”followed by a space and the session ID you wish to log off. Then hit Enter.

Log Off Session

Step 5. Then you’ll see the remote session signing out.

Sign Out Rmote Session

Method 3. End a remote session using qwinsta and rwinsta commands

Step 1. On the remote computer, open Command Prompt. Run the command qwinsta to get all Remote desktop sessions on the server. Type in the following command:

qwinsta /server:SERVER NAME

Note: Replace SERVER NAME with the name of your server. For example, here my server name is wowhvdev1, then I need to type in the following command and press Enter:

Qwinsta Server

Step 2. From the list of sessions, find the one you want to end and note down its ID. Then enter the following command:

Rwinsta /server:wowhvdev1 RemoteID

Note: Replace RemoteID with the ID of the session you want to end. For example, here the ID of the session that I want to end is 11, then I need to type in the following command and press Enter:

Rwinsta Server

AnyViewer: Remote desktop software easy to log off

AnyViewer is the free third-party remote desktop software for Windows. The way to end a remote session completely on AnyViewer is quite easy compared to Remote Desktop. During a remote session over AnyViewer, you just need to click Operation and Logout; then the whole remote session will completely end. See, it’s pretty easy.

Operate Logout

Next, free download it and let's see how to use AnyViewer to connect to another computer remotely:

Download Freeware Win 11/10/8.1/8/7/Server
Secure Download

▶ Importance: It also supports accessing computers from Android or iOS devices; please download AnyViewer mobile apps from Google Play or App Store.

Step 1. Install and launch AnyViewer on both computers. Go to Log in, and then click Sign up. (If you already have signed up on its official website, you can log in directly.)

Log in AnyViewer

Step 2. Fill in the signup information, and you can see you successfully logged in to AnyViewer. Your device will automatically be assigned to the account you've logged in to and listed on My devices list.

Free Editions

Step 3. Log in to the same AnyViewer account on another computer. On your local device, go to Device, click the remote computer, and you can achieve a direct connection by clicking One-click control.

Connect to My Devices

✍Note: If you want to assign more devices to achieve one-click unattended remote access, then you can upgrade your account to a Professional or Enterprise plan. Also, you can connect to another computer in privacy mode, which means you can black the screen and block the mouse and keyboard of the remote computer.


This post summarizes three methods on how to end a Remote Desktop session completely. Firstly, you can sign out a remote session using Ctrl + Alt + End combination. Secondly, it’s possible to end a remote session using its Session ID. Finally, you can also end a remote session using qwinsta and rwinsta commands.

At the end of the post, we recommend the free remote desktop software AnyViewer to you. AnyViewer is easy to connect to and also very easy to log off. If you are worried about not logging off the remote computer after you end a remote session, you can use AnyViewer to get this done easily.