Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Windows NT / Terminal Server / June 2005

Tip: Looking for answers? Try searching our database.

Check for Terminal server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David De Bono - 13 Jun 2005 11:52 GMT
Hi,

How can we in code check if our application is currently running on a
Terminal Server ?

We need to do some optimizations if the program detects that it's running on
TS.

Using VB6 so API calls are no problem.

David
Vera Noest [MVP] - 13 Jun 2005 13:25 GMT
Check the existence and value of this registry key:

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\TSAppCompat
0 is Remote Administration, 1 is Application Server mode

Note that this key will let you see what mode the server is in.  
You can not switch between the modes just by toggling the key.

--
Vera Noest
MCSE,CCEA, Microsoft MVP - Terminal Server
http://hem.fyristorg.com/vera/IT
*----------- Please reply in newsgroup -------------*

"David De Bono" <er_fortsatt@hotmail.com> wrote on 13 jun 2005:

> Hi,
>
[quoted text clipped - 7 lines]
>
> David
David De Bono - 30 Jun 2005 17:45 GMT
Hi,

That worked perfectly.

David

> Check the existence and value of this registry key:
>
[quoted text clipped - 15 lines]
>>
>> David
Mark Yudkin - 19 Jun 2005 10:33 GMT
Call IsOS(OS_WIN2000TERMINAL).

Review IsOS for other values you can query that may more precisely cover the
specific terminal services case you're interested in, but which you didn't
detail in your question.

You can also call GetVersionEx and check the value returned in wSuiteMask
for VER_SUITE_TERMINAL and/or VER_SUITE_SINGLEUSERTS.

If you're only testing, using VerifyVersionInfo with arg2 = VER_SUITENAME
can make your life easier.

> Hi,
>
[quoted text clipped - 7 lines]
>
> David
Harry Bates - 29 Jun 2005 22:00 GMT
Here's a simple way if you are checking from the user's standpoint:

Bases on SESSIONNAME env variable. You might need to test to make sure it is
not XP and is truly a server first so you dont get a false positive from
XP's remote desktop feature.

if environ$("SESSIONNAME")="CONSOLE"
   Terminal services enabled, but is running via console
if environ$("SESSIONNAME")="RDP#"
   Terminal services enabled, and running in a RDP session
if environ$("SESSIONNAME")=""
   No term services enabled

-Harry Bates

> Hi,
>
[quoted text clipped - 7 lines]
>
> David
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.