Thoughts on Software

Forcibly disconnecting users from a remote desktop session

with 3 comments

Following on from my last post on how to find out who is connected to a remote desktop session on  particular machine, there are occasions when you’ll want to actually forcibly disconnect someone so that you can log on to the machine yourself.

Turns out that there’s a command for that …

There’s a two step process of first identifying who you want to disconnect and secondly of actually disconnecting them. So, how to identify the users connected to the remote session and also how long they’ve been idle:

quser /server:[server name]
eg: quser /server:myServer

This gives back a table of information: USERNAME, SESSIONNAME, ID, STATE, IDLE TIME and LOGON TIME. Once you’ve identified who (if anyone) you want to kick off, usually based on who’s been idle the longest, you will need to note down the ID and then use that in the logoff command to actually log the user off:

logoff [id] /server:[server name]
eg: logoff 2 /server:myServer

And that’s it!

Here’s a redacted screenshot of the process in action:

redacted logoff example

Written by andrewlocatelliwoodcock

November 28, 2012 at 21:15

3 Responses

Subscribe to comments with RSS.

  1. Lovely blog! I am loving it!! Will be back later to read some more. I am bookmarking your feeds also.


    November 29, 2012 at 02:53

  2. […] next post covers how to forcibly disconnect users from a session when […]

  3. Very nice post. I just stumbled upon your weblog and wanted to say that I’ve truly loved browsing your weblog posts. In any case I will be subscribing to your feed and I am hoping you write again soon!


    December 3, 2012 at 22:33

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: