R
Rasheed
Guest
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(which is Control Panel -> Add and
Remove Programs -> Add / Remove Windows Components -> Terminal
Services. is Enable or Not) whether Terminal Services are enable or
not so what I need to Do. Kindly provide any code snippet will be
great.
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(which is Control Panel -> Add and
Remove Programs -> Add / Remove Windows Components -> Terminal
Services. is Enable or Not) whether Terminal Services are enable or
not so what I need to Do. Kindly provide any code snippet will be
great.