Clent Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I return a Client Name in my code (vb)?

I am in a Terminal Server environment and I need more than the
Connection.StationID.
 
How do I return a Client Name in my code (vb)?


Whether your code calls the GetComputerName() API or
System.Environment.MachineName, I think the key is what computer is actually
running the code. If you're already logged into the term server, these will
give you the name of the term server, I think. If you want to get the name
of the remote computer that's logged into term server, you'll have to go
another way.

If there is an SDK for Terminal Services (I don't know) you might find a
library for T/S that can give you the name of the remote client because it
seems to me that T/S should know who's connected.
 
it seems to me that T/S should know who's connected.

Yes, T/S does know the Client Name, as does DNS. It seems to me that I
should be able to peek into my current socket somewhere in
"System.Net.Sockets". So far the only examples I've seen show how to open a
new socket.
 
You're after the user name, right, not the computer name? Have a try with:

System.Security.Principal.WindowsIdentity.GetCurrentName()

and see if that does you any good.

Tom Dacon
Dacon Software Consulting
 
Tom Dacon said:
You're after the user name, right, not the computer name?

No, I need the RDP Thin-Client Device Name. Instead, all I seem to be able
to dig up is the Terminal Server Host Name. But thanx for the preview of the
Security Class. I haven't played around with it yet.
 
Back
Top