I assume you're referring to the RDP connection type, right? In this case unfortunately logoff is not possible, as - from our current knowledge - there is no official "logoff" support within the RDP protocol available. Sorry!
How does MobaXterm do it? They have a menu selection that will logoff and close all open RDP Sessions.