Skip to content

RWINSTA command in Windows

The Windows rwinsta command is a useful tool for system administrators to manage remote desktop sessions on Windows servers. With this command, users can reset sessions, freeing up system resources and ensuring smooth operation. By specifying the session ID, administrators can disconnect or log off users remotely, without the need for physical access to the server. This command is particularly helpful in environments where multiple users access the server concurrently, allowing for efficient session management and improved system performance.

RWINSTA Syntax:

Terminal window
rwinsta [SessionID] [/V]

Windows RWINSTA Options:

OptionDescription
SessionIDSpecifies the ID of the session to reset.
/VDisplays information about the actions performed.

RWINSTA Parameters:

ParameterDescription
SessionIDThe ID of the session to reset.

How to use RWINSTA command:

Log off a specific session ID

Terminal window
rwinsta 2

Logs off the session with the ID of 2.

Log off a session remotely

Terminal window
rwinsta /server:Server01 3

Logs off the session with the ID of 3 on the remote server Server01.

List all sessions on a remote server

Terminal window
rwinsta /server:Server02

Lists all active sessions on the remote server Server02.

Display detailed information about a specific session

Terminal window
rwinsta /server:Server03 4 /v

Displays detailed information about the session with ID 4 on Server03.

Log off all disconnected sessions

Terminal window
rwinsta /server:Server04 /disc

Logs off all disconnected sessions on the remote server Server04.

Reset a session on a remote server

Terminal window
rwinsta /server:Server05 5 /reset

Resets the session with ID 5 on the remote server Server05.

Log off a specific session and force the disconnection

Terminal window
rwinsta /server:Server06 6 /v /f

Logs off the session with ID 6 on Server06 and forces the disconnection.

Log off all sessions on a remote server

Terminal window
rwinsta /server:Server07 /all

Logs off all sessions on the remote server Server07.

How do I use rwinsta in Windows?

To use the rwinsta command in Windows, execute the following command:

Terminal window
rwinsta <SessionID>

How can I disconnect a specific user session using rwinsta?

To disconnect a specific user session with rwinsta, run the command with the session ID of the user you wish to log off:

Terminal window
rwinsta 2

How do I force log off a user session with rwinsta?

To force log off a user session using rwinsta, add the /server option followed by the target server name and /v (verbose) flag as shown:

Terminal window
rwinsta /server:ServerName /v

Can I list all Remote Desktop (RDP) sessions with the rwinsta command?

Yes, you can list all Remote Desktop sessions using a separate command before using rwinsta. To list all sessions, execute:

Terminal window
qwinsta

How do I remotely log off another user using rwinsta from the command line?

To remotely log off another user from the command line with rwinsta, specify both the server name and the session ID for the remote logoff operation:

Terminal window
rwinsta /server:ServerName <SessionID>

What is the difference between rwinsta and logoff commands in Windows CMD?

While rwinsta is used to reset (log off) a Remote Desktop Protocol (RDP) session, the logoff command is used to close a local user session. rwinsta is specifically for RDP sessions.

How do I log off a user with a temporary desktop session using the rwinsta command?

To log off a user with a temporary desktop session in Windows CMD with rwinsta, specify the session ID of the temporary session you want to disconnect:

Terminal window
rwinsta 3

Can rwinsta be used to log off multiple user sessions simultaneously in Windows?

Yes, rwinsta can be used to log off multiple user sessions simultaneously. To do this, run rwinsta commands for each session ID you wish to log off:

Terminal window
rwinsta 1
rwinsta 2
rwinsta 3

Applications of the RWINSTA Command

  • Log off a user from a Remote Desktop session
  • Disconnect a Remote Desktop session
  • List the sessions on a Remote Desktop Session Host server