Question Getting username from Terminal Services

Arg81

Well-known member
Joined
Mar 11, 2005
Messages
949
Location
Midlands, UK
Programming Experience
1-3
Hello

Haven't posted on here for quite a while!! Hope everyone is well.

When users use my app, they log into Terminal Server and open the program from a shortcut on their desktop.

I use some code which takes their user logon (they log onto TS with their network username and password).

The code to do this is:
VB.NET:
Dim s As New Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent)
LoggedOnUser = s

I then use this string throughout the app for security and auditing purposes (so when a record is added / edited, it stamps their username to it)


however we now have a Server 2008 machine and I am looking to use TSWeb to publish the app remotely as this seems to have much better performance for our remote users.
The only thing is, the application now can't get the username.

What do I need to change to that code? I assume because it's using IIS it's pulling over the default IIS username, instead I need it to record the username of the user credentials entered when connecting to the app.

I would of thought that they were still logging into TS as they have to enter their username and password, I have a feeling this isn't possible and I'm going to have to revert back to the old way.
I don't really want them having to log into TS and then into the application...


Thanks in advance for any tips.
 
Back
Top