Wednesday, December 12, 2007

shutdown multicomputer remotly

For system admins :

shutdown /r /m \\computername /t seconds /f {force shutdown, no warning} or shutdown /i or

Try this VBScipt. Copy and paste the below text in to notepad. then save it with the extension .vbs. Then when you double click it, it should give you an input box. What ever IP or PC name you enter there will be shut down!:

Sub RebootComputer( strServer )
Set objOSSet = GetObject("winmgmts:{(RemoteShutdown)}//" & strServer & "/root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")

For each objOS in objOSSet
objOS.Reboot()
Next
End Sub


' *************************************************************
' Main
' **************************************************************
Dim strComputer
Do
strComputer = inputbox( "Please enter the name of the computer you want to reboot", "Input" )
Loop until strComputer <> ""

RebootComputer( strComputer )

WScript.Echo( "Computer " & strComputer & " rebooted" )

No comments: