Remotely Managing Terminal Services Session via Command Line

  1. qwinsta –> Display information about Terminal Sessions.
  2. rwinsta  –> Reset the Terminal session Ex: rwinsta <session ID> /server:<servername>
    Usage Examples:
    Find all the terminal service sessions:

C:>qwinsta /server:Test-SRV1
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
console           test-admin                0  Active  wdcon
rdp-tcp                                 65536  Listen  rdpwd
                   temp-admin                3  Disc    rdpwd
                   demo-user                 1  Disc    rdpwd

C:>

End the session you want, say the one in disconnected state:

C:>rwinsta 1 /server:Test-SRV1 (This will end the session with ID ‘1’ that is of demo-user session running in disconnected state )

C:>

Verify that the session indeed got disconnected:

C:>qwinsta /server:Test-SRV1
SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
console           test-admin                0  Active  wdcon
rdp-tcp                                 65536  Listen  rdpwd
                   temp-admin                3  Disc    rdpwd
C:>

Leave a Reply

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