I only know how to get the current session ID, but how do you know the current login user is the local logon, or via remote desktop login?
Seen a same problem the other day, I only remember a Chenhui530 solution is given, and seems to be calling WTSQuerySessionInformation, but I can't find the post now, who knows please help, thank you,