2

I encountered an interesting situation today that I didn't know about.

I logged in by user A using server dns host name SERVNAME and got myself session and my desktop. I put on the desktop some file.

Then my friend also logged with the same user A, but using server's IP xxx.xx.xx.x and Windows created a second session for the same user A and second version of desktop! He did not see the file from my desktop and moreover hadn't kicked me out of my session as I expected.

But if he connects by server's name SERVNAME he kicks me out of session.

  • Yes, it is the same server.
  • The option Restrict each user to a single session is set to Yes (fSingleSessionPerUser = 1)

How can it be? What is the difference in logging by IP or domain name?

7
  • Pointing to a domain directs to a specific point on a network while an IP could contain a host of domains. A web server would be a good example of this. Does your IP host multiple servers using remote desktop? Mar 31, 2014 at 14:39
  • @MatthewWilliams cannot say, it's a virtual server though. What is the difference to windows OS if my IP hosts multiple servers?
    – Rodion
    Mar 31, 2014 at 14:57
  • The issue is not hosting multiple servers, its the configuration used to remote into a system. You might have several servers listening on port 3389 for RD requests. By listing only an IP there is no reference to which server you have requested. A server name gives you a specific system to point to. Are you use your friend got into the same server as you did? Mar 31, 2014 at 15:06
  • @MatthewWilliams of course it is the same server. For acknowledgment I copied the file to system drive c and my friend got it.
    – Rodion
    Mar 31, 2014 at 15:13
  • 2
    If the machine can't use a single session will it use a temp profile
    – Dave
    Apr 3, 2014 at 12:26

3 Answers 3

3

There are two questions here:

1.) Why is Windows Terminal Services not restricting User A to one session?

It says Users can open multiple sessions to a server that is restricted to a single session for each user.

It goes on to say This functionality is working as expected. This setting is limits each user to one unique session. However, if the user is running different initial programs, the sessions are considered as different sessions.

Using the server's hostname vs. its IP address is enough for Windows think that sessions are unique.

2.) In my session, I have a file on desktop, why is this file not showing up in the second session?

Windows is creating 2 unique sessions, so therefore it is creating a second unique profile for the second login of User A. If go to a command prompt you will see one session starts in C:\Users\User A\ and the second session is C:\Users\User A.000\. Similarly have a look at C:\Users from a Windows File Explorer window.

4
  • 2) - no User A.000, only User A 1) - very interesting, so you are implying that Remote Desktop Connection in different loggins differently... doing what? Setting what program? Set any program to run on connection and then connect to the Windows Server-based computer
    – Rodion
    Apr 7, 2014 at 10:57
  • That's the text form the MS Knowledgebase. I see this behaviour all the time on our servers where different admins are logging in with the Domain Admin users, and they have different sessions open up.
    – David
    Apr 7, 2014 at 12:25
  • With having 2 different sessions for the same users, windows will create a second profile for the second user, otherwise you run into problems with things like the user registry hive/store.
    – David
    Apr 7, 2014 at 12:28
  • 1
    This does not explain why with DNS the same login kicks out the existing session but not with IP.
    – harrymc
    Apr 8, 2014 at 4:49
1
+50

I would guess that when going either through DNS or via IP address there is a difference in the identification of the computer that is originating the RDP request.

The difference might be in the user-name acquiring a different qualifier, for example WORKGROUP.

I suggest to logon using both methods, then in a Command Prompt (cmd) use the whoami command to find the exact user account that is used:

whoami /user

If there is a difference, then you have found your answer.

[EDIT]

As you have found that in both cases there is exactly the same user in the same domain and with the same SID, then my only explanation is a difference that is not visible to you. It might be that because of the DNS request your connection request does not follow the exact path in the network that is taken when using the IP address.

My personal conclusion is that Windows in that case does not search for the connection in the right place, does not find the existing connection and so opens up a new session/desktop. However, when the login process executes in this new desktop, it logs you in under your correct user account / SID, so the same user ends up as having two desktops.

You might be able to further research that possibility using the LogonSessions utility from Sysinternals, which gives more detailed information about the currently active logon sessions. Another possibly useful utility is EnumWinsta GUI which displays the list of window stations and desktops.

More information can be found in the article :
Windows Sysinternals : Windows Core Concepts - Sessions, Window Stations, Desktops, and Window Messages.

In other words, I believe this is an undocumented bug in RDP, which you should report. Unfortunately, Microsoft Connect does not accept bugs for Windows, so your only option is to go on the Microsoft Windows Forums and hope that someone from Microsoft will pass it on to be corrected in some unknown time in the future.

6
  • Exactly the same user in same domain and with the same SID.
    – Rodion
    Apr 7, 2014 at 10:38
  • I have added above my conclusions from your findings.
    – harrymc
    Apr 7, 2014 at 11:00
  • This is not a bug, this is expected behaviour. See my answer below, with referenced kb article. MS Terminal services will only limit a user to one session if the session details are exactly the same. Using hostname vs the IP address is enough for Windows to think that the sessions are different.
    – David
    Apr 7, 2014 at 22:39
  • @David: The bug is not in having multiple sessions and desktops. The bug is in not getting the same results when connecting via different network paths. Remember that with DNS one user kicks out the existing session but not with IP.
    – harrymc
    Apr 8, 2014 at 4:48
  • Windows is not looking at the source, but the destination in order to make the determination of a unique connection. When the first user uploads a file to his desktop, it does not show on the second session desktop for good reason: each session needs exclusivity. There is no bug here.
    – David
    Apr 8, 2014 at 21:43
0

Explanation

As the comments above have stated, server based terminal services accept multiple connections to the same machine, either from multiple different users or (if configured) concurrent logins for the same user.

How can it be? What is the difference in logging by IP or domain name?

There's no difference, you're remoting on to the same machine, just using two different methods to do so. 1) The hostname which simply looks up and resolved the IP and 2) using the IP instead of the domain, that's basic DNS.

Concurrent Logins

There's a registry value within the Terminal Server subkey that is responsible for multiple same user connections and that's the fSingleSessionPerUser DWORD.

Open regedit (Windows Key+R) -> regedit + enter

Navigate to

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer

Double click or right-click –> modify the key fSingleSessionPerUser

I imagine the value is set to 0, change this to 1.

  • 0 = Multiple sessions per user
  • 1 = Single session per user

Apply the changes and restart remote desktop services. (see below)

Open cmd (Windows Key+R) -> cmd + enter

Type net stop termservice and press enter, then net stop termservice and press enter.

The above answer is tested on the latest release of Windows Server 2013, and dates back to I believe Windows server 2003.

2
  • If There's no difference, you're remoting on to the same machine, just using two different methods to do so. 1) The hostname which simply looks up and resolved the IP and 2) using the IP instead of the domain, that's basic DNS. Why I am being kicked from session if second user connects as myself by name in domain?
    – Rodion
    Apr 3, 2014 at 12:09
  • And as I said in the question there is already Single session per user = 1, checked it in regedit too.
    – Rodion
    Apr 3, 2014 at 12:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .