I need to find out if the current user is a RDP Session, that is simple but I need to know if the session is initiated with the '/admin' flag.
In the past I use the Session Id, that was 0 but now on newer Windows Versions its not 0 anymore.
[DllImport("Kernel32.dll", SetLastError = true)]
[return:MarshalAs(UnmanagedType.U4)]
public static extern int WTSGetActiveConsoleSessionId ( );
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more