PC Review


Reply
Thread Tools Rate Thread

Check Terminal Services is Enable or Not Programatically Using C++ or VC++ code

 
 
New Member
Join Date: Jun 2008
Posts: 1
 
      19th Jun 2008
Hi all,

I need to check Terminal Services is Enable or not on a remote machine. I find one link from this Forum. link is as below :



http://www.pcreview.co.uk/forums/thread-1609344.php



and i have get the code as below and executed.



BOOL Is_Terminal_Services ()

{

OSVERSIONINFOEX osvi;

DWORDLONG dwlConditionMask = 0;

// Initialize the OSVERSIONINFOEX structure.

ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));

osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);

osvi.wSuiteMask = VER_SUITE_TERMINAL | VER_SUITE_SINGLEUSERTS;

// Initialize the condition mask.

VER_SET_CONDITION( dwlConditionMask, VER_SUITENAME, VER_OR );

// Perform the test.

return VerifyVersionInfo(

&osvi,

VER_SUITENAME,

dwlConditionMask);

}



int _tmain(int argc, _TCHAR* argv[])

{

bool bflag = Is_Terminal_Services () ;

}



But even I am unable to analyze. Because if my Terminal service is stopped then it returns 0 else it returns 1.

But my Terminal service is not enable in Control Panel -> Add and Remove Programs -> Add / Remove Windows Components -> Terminal Services.



So I need the check the above thing whether Terminal Services are enable or not so what I need to Do. Kindly provide any code snippet will be great.





 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code pause when disconnecting from Terminal Services. Trefor Microsoft Outlook VBA Programming 0 18th Nov 2008 08:35 AM
Mapping my Terminal Services User Profile to my Terminal Services Home Folder neil.harvey@hen.invesco.com Microsoft Windows 2000 Group Policy 0 20th Apr 2007 11:41 AM
To enable Terminal Services IPRHE Microsoft Windows 2000 Active Directory 5 5th Mar 2004 06:55 PM
enable auditing of clients logging in on terminal services?? loveleen Microsoft Windows 2000 Terminal Server Clients 1 29th Sep 2003 07:43 PM
Problem with spell check on one client using Terminal services Terri Touchton Microsoft Outlook Discussion 0 15th Aug 2003 04:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:45 AM.