Discussion:
Sensing Log-on computername programmatically
(too old to reply)
John Goins
2006-03-24 15:15:11 UTC
Permalink
Is there a way to read the computer name that a user uses to log onto
Win2003 Terminal Server? I would like to give different rights based on the
computer name. Is this possible?

Thanks,

Jay Goins
Vera Noest [MVP]
2006-03-24 15:28:02 UTC
Permalink
From http://ts.veranoest.net/ts_faq.htm

Q. How can I retrieve the client IP number?

A. You can retrieve the client IPnumber and computername with the
WTSQuerySessionInformation function, or the client computername with
the environment variable %CLIENTNAME%.

Recommended reading:

http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/termserv/termserv/wtsquerysessioninformation.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/termserv/termserv/terminal_services_programming_guidelines.asp
_________________________________________________________
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
TS troubleshooting: http://ts.veranoest.net
SQL troubleshooting: http://sql.veranoest.net
*----------- Please reply in newsgroup -------------*
Post by John Goins
Is there a way to read the computer name that a user uses to log
onto Win2003 Terminal Server? I would like to give different
rights based on the computer name. Is this possible?
Thanks,
Jay Goins
John Goins
2006-03-24 16:08:15 UTC
Permalink
Thank you, Vera!

Jay Goins
Post by Vera Noest [MVP]
From http://ts.veranoest.net/ts_faq.htm
Q. How can I retrieve the client IP number?
A. You can retrieve the client IPnumber and computername with the
WTSQuerySessionInformation function, or the client computername with
the environment variable %CLIENTNAME%.
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/termserv/termserv/wtsquerysessioninformation.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-
us/termserv/termserv/terminal_services_programming_guidelines.asp
_________________________________________________________
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
TS troubleshooting: http://ts.veranoest.net
SQL troubleshooting: http://sql.veranoest.net
*----------- Please reply in newsgroup -------------*
Post by John Goins
Is there a way to read the computer name that a user uses to log
onto Win2003 Terminal Server? I would like to give different
rights based on the computer name. Is this possible?
Thanks,
Jay Goins
Loading...