RE: Detecting a Terminal Server session



Hi Mike,

You probably are running with Fast User Switching feature on XP. Please
note fast user switching is implemented using Terminal Service sessions.
The first user to log on uses session zero, the next user to log on uses
session one, and so on.

The most reliable way to get client name is to use
WTSQuerySessionInformation:

#WTSQuerySessionInformation
http://msdn2.microsoft.com/en-us/library/aa383838.aspx

However, I understand this might be too complicated to call WTS api in VB6
than simply checking for the environment variables. Actually, in your case,
I think simply checking for the CLIENTNAME environment variable will be
suffice to determine if it's a terminal session and what's the client name.

You can also check if it's realy running under a terminal session or not by
using another simpler API GetSystemMetrics:

#Detecting the Terminal Services Environment
http://msdn2.microsoft.com/en-us/library/aa380798.aspx


Hope this helps.


Sincerely,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: Oracle Directconnect (ODC) Security - is it ok?
    ... The following information about session security for Expertcity's ... DesktopStreaming allows a support agent to see the end user's screen ... > and select the appropriate engineer from a dropdown list. ...
    (comp.security.misc)
  • RE: ASPX page cant see Session created by WCF with XBAP client
    ... As for the setup ASP.NET seesion in WCF, ... Also, based on my understanding, you're using ASP.NET session to store ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Win32_NetworkConnection closes connectios in remote monitoring?
    ... There's also a difference between hacking into a session that's already established and creating a new one. ... I've reproduced the issue on my side that the mapped driver shows "Unavailable" status when it's queried from a remote computer with the Win32_NetworkConnection class. ... In "computer 2", query the local mapped drivers' status with wbemtest, and it returns the "OK" status for the newly created mapped driver. ... We welcome your comments and suggestions about how we can improve the support we provide to you. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: cdevpriv and mmap(2)
    ... driver method. ... Second calls are much harder and essentially require attaching cdevpriv bookkeeping data to the struct vm_map_entry. ... I am not sure whether this support for the second time calls is needed at all in real usage. ... In order to implement session-centric semantics, I think it's actually quite a bit more complicated than just adding vm_map_entry book-keeping -- we also need to have a different VM object for each session. ...
    (freebsd-current)
  • Re: Task Manager
    ... > The Users Tab appears when the Welcome Screen and Fast User Switching is ... You need to have Terminal Services enabled and running in order to ... client computer using the session, ... The Users tab is displayed if you have enabled Fast User Switching. ...
    (microsoft.public.windowsxp.general)