RAS cross-logins

Developer
Apr 30, 2013 at 5:30 PM
We've got a situation where it is (very) useful for a connection to be created by one user on a machine, then Remote Desktop kicks in from another user once the network is available. Problem is that RAS connections seem to terminate when the RDP user comes in. ("error 830")Is there a setting which would allow the connection to persist?

I've googled this and don't find anything useful ... so I figured I'd ask here.
Coordinator
May 1, 2013 at 3:51 AM
Hah, I might actually be able to help you for once Keith!

I found an article that talks about adding a registry setting so the connections may persist across user sessions.
http://support.microsoft.com/kb/158909

It doesn't work with Windows Vista and later, because Microsoft moved the setting to a different location within the registry. After finding the new location, I have confirmed that my Windows 8 box does in fact have that setting currently disabled.

Windows 2000 - Windows XP
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
Add REG_SZ (confirmed not a DWORD) named KeepRasConnections
Set value to 1

Windows Vista and later
HKLM\SYSTEM\CurrentControlSet\Services\RasMan\Parameters
Add DWORD named KeepRasConnections
Set value to 1

Both appear to require a restart for the setting change to take effect.

I did some additional searching and it would appear people have had behavioral problems with this setting, might want to give this a look while you're at it.
http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/d92abb1c-8c78-40e2-8f37-c0bd45db5973/

-Jeff
Developer
May 1, 2013 at 2:31 PM
Alas, I've seen all of that, and I don't think it helps us.

It seems those only work if you keep the user which made the RAS connection logged in, which of course doesn't work if the tech account (in our case) has to log in as himself. I've posted on MSDN as well, now that I seemingly have access to it.
Developer
May 6, 2013 at 7:57 PM
Hm, does DotRas call HangUp when the application which initiated the connection quits? My tech support tester is saying the little tech support application doesn't work even with a new registery hack which works to persist past logout for manually dialed phonebook entries.
Coordinator
May 7, 2013 at 12:48 AM
Nope, the only time hang up is called is when an external call is made to RasConnection HangUp, or when a dial attempt with RasDialer is cancelled.
Developer
May 8, 2013 at 2:40 PM
I've gotten an apparently official answer which includes a missing piece of the puzzle I've yet to fully investigate, but it prompts another question for this forum.

The missing piece appears to be that one (in Vista or later, as we are using) has to also save the credentials for all users and not just use an "in memory" or whatever version when connecting. Now, the question for here: we have a phonebook entry for a carrier which uses APN and SIM to determine subscribers, etc. Consequently, there are no credentials strictly speaking. The DotRas documentation doesn't say much about what format the username and password have to be. Is the "empty credentials" case the case of String.Empty for username and password? Or do I not touch them at all and save them as is (for all users) or something else? For what it is worth I've followed up on MSDN to ask about the empty case to see if that affects the persist, as that is always tricky - we weren't saving anything from that one at all, which is sort of but not quite like saving nothing ...
Coordinator
May 9, 2013 at 3:56 AM
From what I could see in the SDK, the ClearCredentials method on RasEntry basically sets the username and password to empty strings. If you don't touch them, they should be the default which I imagine would be empty. Whether it will work or not without credentials I am not sure, however from what I can tell the DotRas SDK shouldn't care whether you pass or do not pass credentials to the dialer when you dial the connection.