开发者

What API will allow me to detect and end the session of someone using "mstsc /console"?

I'm having a very difficult time listing and closing the sessions of folks using Mstsc /admin.

Does anyone know the AP开发者_运维问答I to use if the server is a normal server and not a terminal server per-se?


You can use the LsaEnumerateLogonSessions function to get a list of all logged in sessions, and use LsaGetLoginSessionData to determine what type of session it is.

If you're only interested in remote desktop sessions, WTSEnumerateSessions might be helpful as well. If you'd like to force a logoff, you can use WTSLogoffSession.


You can start with WTSEnumerateSessions or WTSEnumerateSessionsEx.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜