title: How to find the Remote Deskop SessionID when using MSTSCLib
body: <p>I am trying Writing a remote desktop client for use in my testing environment.</p>
  
  <p>The goal is to logon to a computer (new virtual machine) for the first time, let the user profile and everything that happens during the first logon happen, and then log off.</p>
  
  <p>I'm able to create the session and logon to the computer as the user using the MSTSCLib/AxMsRdpClient6NotSafeForScripting interfaces.</p>
  
  <p>Now I am wanting to log the user off the computer (not just disconnect) using the WTSLogoffSession function. But this function requires the Session ID and I cannot figure out how to find it for the current session running in the RdpClient interfaces.</p>
  
  <p>Where/how do you find the session id for the session in the RDP session that you have created? It seems like this should be a property or something easily found somewhere but I have found it anywhere.</p>
  
  <p>I assume that I am going to hit myself in the head when a simple solution is given, but it is avoiding me so far.</p>
  
  <p>Thanks</p>