使用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
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
相关文章推荐
- 【附】使用监听器ServletContextListener实现网站登录人数统计,可以实现重启服务器后记录仍然存在
- 如何使用H5判断登录页面手机号码长度是否正确和账号密码不能为空,从而减少对服务器的请求(注册也一样)
- 使用VS2003创建WEB程序的时候出现"AutoMation服务器不能创建对象"错误
- sql server中分布式查询(链接服务器(sp_addlinkedserver)和远程登录映射(sp_addlinkedsrvlogin)使用小结)
- 使用putty(ssh)密匙安全登录服务器
- acegi 登录ie时cookie不能保存, firfox可以使用
- ASP中使用FSO提示“Automation服务器不能创建对象”的问题
- 开3389后不能登录的六种原因
- 远程终端登录进行服务器重启的有效办法
- 服务器间通过ssh使用密钥对实现无密码登录solaris,redhat,linux
- Fedora 10/11下解决不能使用root用户登录系统
- 解决使用gnome关机菜单不能关机或重启问题
- 在作一个使用WMI进行服务器状态监控的小软件
- 使用ssh登录服务器
- 怎么使用户能访问ftp,但不能远程登录
- 使用VNS 使用XWINDOWS 登录远程服务器方法
- 使用Visual Studio.Net,系统报告“automation服务器不能创建对象”错误。解决之道运行:regsvr32 scrrun.dll 就可以了。
- 同一台服务器上,安装OC4J之后Oracle数据库不能使用,解决方法
- windows xp sp3使用telnet登录到163 smtp服务器 base64编码 c#
- 使用VS2003创建WEB程序的时候出现"AutoMation服务器不能创建对象"错误