请教,windows 2000专业版如何远程重新启动? 1、计算机有公网固定IP. 2、知道超级用户名字和密码。 3、

给你个脚本试试

on error resume next
if (lcase(right(wscript.fullname,11))="wscript.exe") then
set objShell=wscript.createObject("wscript.shell")
objShell.Run("cmd.exe /k cscript "&chr(34)&wscript.scriptfullname&chr(34))
wscript.quit
end if
if wscript.arguments.count<>3 then
usage()
wscript.echo "Error: Not enough parameters."
wscript.quit
end if

ipaddress=wscript.arguments(0)
username=wscript.arguments(1)
password=wscript.arguments(2)

if ipaddress="127.0.0.1" or ipaddress="localhost" then
strComputer="."
wscript.quit
end if

wscript.echo "Conneting "&ipaddress&"...."
set objlocator=createobject("wbemscripting.swbemlocator")
set objswbemservices=objlocator.connectserver(ipaddress,"root/default",username,password)
showerror(err.number)

set objlocator=createobject("wbemscripting.swbemlocator")
strComputer=ipadress
set objswbemservices=objlocator.connectserver(ipaddress,"root\cimv2",username,password)
Set colOperatingSystems = objswbemservices.ExecQuery_
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Reboot()
Next

function showerror(errornumber)
if errornumber<>0 then
wscript.echo "Error! "
wscript.quit
else
wscript.echo "OK!"
wscript.echo " "
end if
end function

function usage()
wscript.echo "Reboot the RemoteHost "
wscript.echo "Welcome to www.isgrey.com"
wscript.echo " "
wscript.echo "Usage:"
wscript.echo "cscript "&wscript.scriptfullname&" targetIP username password"
wscript.echo " "
end function

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus