strComputer
= "dscp xxxxx“
' Mention machine
name / IP address
Set
objWMIService =
GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\"
& strComputer & "\root\cimv2")
Set
colOperatingSystems = objWMIService.ExecQuery("Select * from
Win32_OperatingSystem")
For
Each objOperatingSystem In colOperatingSystems
objOperatingSystem.Reboot()
//objOperatingSystem.Win32Shutdown(1)
‘ “1”
is for Shut Down
-->for shudowning
Next
No comments:
Post a Comment