如何获得终端会话开始的通知

发布于 2024-08-31 08:03:44 字数 54 浏览 2 评论 0原文

我想在终端服务启动时禁用应用程序。有没有一种方法可以注册某些服务,当有人远程登录时会发出通知?

I want to disable an app when terminal services start. Is there a way to register with some service that will notify when some logs in remotely?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

断爱 2024-09-07 08:03:44

无法收到通知,但您可以定期检查 SystemInformation.TerminalServerSession 并采取相应措施。

但是,如果您的程序无法通过 RDP 运行,那么想要远程使用它的人将只能使用 VNC。或团队查看器。或者其他方法。我只想说,我认为不在 RDP 会话中远程工作甚至主动避免这样做是一种不好的行为或程序。

There is no way to get notified of it but you can periodically check SystemInformation.TerminalServerSession and act accordingly.

However, if your program doesn't work through RDP the people who want to use it remotely will just use VNC. Or TeamViewer. Or other methods. Suffice to say that I consider it poor behavior or a program to not work remotely in an RDP session and even actively avoiding to do so.

下雨或天晴 2024-09-07 08:03:44

I suggests you listen to ETW events raised by WMI around the RDP objects, like Win32_SessionDirectorySession, Win32_Terminal, Win32_TSRemoteDesktop and other. There are various articles describing how to wrap MOF queries into ETW sessions:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文