Query all RDP sessions using .net
I am a lot of difficulty finding a way to query all RDP sessions using .net. Anyone know of a wa开发者_StackOverflowy to return this data without having to parse the results of a qwinsta.exe call?
Currently i am using the qwinsta method, but this is returning some very unexpected results when querying different os installations (2003/2008/2008r2 etc.).
You can do this using the various WTS* functions (WTSEnumerateSessions and friends), or using the Cassia library, which provides a wrapper for those unmanaged API calls.
精彩评论