The MSDN function is alled WTSQuerySessionInformation. I did some testings as far as my entry level coding skills allows me, but I must be missing something.
Basically, I need to check several times a day if and who is logged on into a RDP server, by checking a specific session id. In my imagination and pseudo-code, i imagined it will go something like supply the server, the session id, and get the username.
Skipping the high tech details and issues with WTS_INFO_CLASS and what not, my top concern is if WTSQuerySession is even designed to work on a totally remote server? The servers in question are not on my network and either one of them is linked to any other.