您的位置:首页 > 其它

使用WMI重启不能用3389登录的服务器

2004-10-15 06:50 453 查看
远程重启动服务器的VBscript,其实重起的办法也有很多,比如用SQL的查询分析器等。

strComputer = "192.168.0.1"
strUsername="ABC"
strPassword="EFG"

Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer(strComputer ,"\root\cimv2", strUsername ,strPassword)
objWMIService.Security_.ImpersonationLevel = 3

Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Reboot()
Next
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐