I need to get the underlying client PC name from a user’s terminal server session.
I know it lives in HKEY_CURRENT_USER\Volatile Environment\CLIENTNAME but is there another (preferably native .net) method of getting it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I didn’t see a managed API for this. The only API-based ways I could see for getting at this information would be through WMI or the native Terminal Services API in Windows.
Here is an example that returns the client name using the
WTSQuerySessionInformationAPI: