' *********************************** *********************************************
' Ky funksion reboots nje remote computer / Guys this function reboots a remote compute
' Application Language: Visual Basic (V.B)
' Authot: CoNtRoLLeR
' E-Mail:
NetControll@GeekSquad.NetworkEngine.com
' Company: Geek Squad - Network Enginiers
' Date: 6/12/2006
' *********************************** *********************************************
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" )