Cassia did the trick for me...
From the link listed above, and thans to Alex K for pointing me in the right direction, I just didn't was to do any p/invoke without a covering library.
Cassia supports the following operations on both local and remote terminal servers: * Enumerating terminal sessions and reporting session information including connection state, user name, client name, client display details, client-reported IP address, and client build number (WTSEnumerateSessions, WTSQuerySessionInformation, and friends) * Logging off a session (WTSLogoffSession) * Disconnecting a session (WTSDisconnectSession) * Displaying a message box in a session and getting a response from the user (WTSSendMessage) * Enumerating all processes (WTSEnumerateProcesses) * Killing a process (WTSTerminateProcess) * Shutting down or rebooting the server (WTSShutdownSystem) In addition, Cassia supports enumerating all terminal servers on a domain (WTSEnumerateServers).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.