Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Sep 09, 2015 11:55 pm Post subject: How to block Terminal Services but not Remote Desktop |
|
|
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 |
|