Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to block Terminal Services but not Remote Desktop

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> Licensing FAQ
View previous topic :: View next topic  
Author Message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Sep 09, 2015 11:55 pm    Post subject: How to block Terminal Services but not Remote Desktop Reply with quote

The Block Terminal Services option blocks the use of the RDP protocol which means that single sessions of Remote Desktop are also blocked.

If you would like your customers to still be able to use Remote Desktop to access their machine - but want block the use of RDP for Terminal Services then you can set the default BlockTerminalServices property to true only if the Operating System is a windows server OS. This requires an interop call to check the OS:

Code:
[DllImport("shlwapi.dll", SetLastError = true, EntryPoint = "#437")]
private static extern bool IsOS(int os);

/// <summary>
/// Should terminal services be blocked
/// </summary>
/// <returns>True if terminal services should be blocked</returns>
/// <remarks>Only blocks Terminal services for servers</remarks>
private static bool BlockTerminalServices()
{
    const int OS_ANYSERVER = 29;
    return IsOS(OS_ANYSERVER);
}


You then set the BlockTerminalServices property before using the licenseProvider ie:

Code:

_licenseProvider.Parameters.BlockTerminalServices = BlockTerminalServices();
_license = _licenseProvider.GetLicense();

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> Licensing FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group