时间表已关闭 [英] Schedule shut down

查看:80
本文介绍了时间表已关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!
我想用C#中的代码在指定的时间自动关闭网络中的所有计算机(即计划关闭).如果有人可以指导我获得任何有用的材料,我可以学习并参考以定义校园实验室中所有用户的每日登录配额,以便他们只能在指定的时间段内使用计算机,而在该时间段内不能使用时,我将不胜感激.

解决方案

您可以使用Win32_OperatingSystem类中的Win32ShutDown方法关闭远程计算机.您可以设置一个计时器集,该计时器可以跟踪远程计算机的启动并在时间结束后关闭.

要跟踪远程计算机的启动时间,请使用LDAP.检查 lastLogonTimeStamp [ 解决方案

You can make use of Win32ShutDown method in the Win32_OperatingSystem class to shut down the remote computer. You can have a timer set which would track the start up of the remote computer and shut down after the time is over.

To track the start time of a remote computer, use LDAP. Check the
lastLogonTimeStamp[^] to get the login time. DirectorySearcher class will help you in getting that value.

IMO, instead of having a program running on one computer monitoring all the computers, have a simple application running on all the computers. This application should start at the log in and would shut the computer down after the allotted time is over.


I advise you to NOT shut the computers down, but to simply log them off.

To implement this, I would write a Windows service and install it on all of the lab''s PCs. If you wanted to get really fancy, you could maintain a database on a server somewhere used to both store c0onfiguration info (regarding max time allowed to be logged in, etc) and to collect usage info on a user-by-user basis.


这篇关于时间表已关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆