How can we know and free remote login session in Windows Server 2008 ?

Through this post , I want to share about the problem we faced while working in Windows Server 2003/2008.

In our day to day work , we might frequently need to connect to remote Windows Server machine and while we try to connect to the Windows Server which allows multiple login session, sometimes we get an error message as : if there is no any free sessions “

If you need to connect the server urgently for your high priority task to complete then you simple need to find the sessions in that server and free one session for your login access and to complete your job. Also, Most of the already logged in users won’t even be using the session at the time and there might be some session which has been disconnected for a long time.

How can we know remote login session in Windows Server 2008?

For this,  we need to find out the RDP login sessions both active/disconnected in that particular Windows Server machine. First of all you must be logged in to your client computer as a domain Admin user and then You can use the query from the command line as:

C:\>query session /server:SERVERNAME
Or
C:\>qwinsta /server:SERVERIP

You can simple type the Server IP Address or Server Name and you will get the both active and disconnected session in that particular server as:

session

How can we free remote login session in Windows Server 2008?

From the above we can see that ahal user has a disconnected session ID#2 , so we can free this session if that user has not been doing any work in that server . you need to make sure that user hasn’t running or doing any work in offline or disconnected mode for this you can simple chat with him or just inform.Otherwise, if maharjan user  finishes his work and still in active state then you can kill one of these two session by using the query below.

C:\>reset session 2 /server: SERVERIP 
Or
C:\>rwinsta /server: SERVERIP SESSIONID

For killing the session ID#2 for ahal user terminate .

If you want to see additional information you can run the command above with [/v]

C:\>reset session 2 /server: SERVERIP  /v

Resetting session ID 2
Session ID 2 has been reset

Now , you can check the sessions in that server by simple using C:\>qwinsta /server:SERVERIP and make sure the user session is terminated and do the needful job by connecting your own session.

Hope this blog post might help for you who faces such problem in our day to day work.

Thanks,

Anil Maharjan