以编程方式远程注销活动域用户
我需要能够从程序中注销任何用户的 Windows 会话。
我知道我可以以管理员身份登录并强制远程注销。 有没有其他方法可以在不登录的情况下强制注销?
该工具将以管理员身份运行,因此这不是问题,无需登录即可远程注销才是问题。
工具采用 .NET,但欢迎任何其他方式(JScript、从 PInvoke 运行的命令行工具等)
I need to be able to logoff any user from his windows session from a program.
I know I could log in as an admin and force a remote logoff. Is there any other way to force a logoff without logging in?
The tool will run as admin so that's not a problem, being able to remote logoff without logging in is.
Tool is in .NET, but any other way is welcome (JScript, command line tool to run from PInvoke, etc.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许与 Sysinternals 的 PsTools 一起使用,特别是 PsShutdown?
Perhaps with Sysinternals' PsTools, particularly PsShutdown?
终于在这个页面找到了这个脚本: http://www.robvanderwoude.com/files/logoff_vbs .txt
我决定将其作为字符串存储在工具内,并将其写入磁盘,执行它并删除它。 不是特别优雅(是的,是的,丑得要命),但目前已经足够好了。
Finally found out this script in this page: http://www.robvanderwoude.com/files/logoff_vbs.txt
I decided to store it as a string inside the tool and make it write it to disk, execute it and delete it. Not particularly elegant (yes, yes, ugly as hell), but good enough for now.
您可以使用简单的命令行从任何远程用户强制注销,如下所示
You may use simple command line to logoff forcefully from any remote user as below