Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
673 B

  1. On Error Resume Next
  2. ' Create the Locator
  3. Dim theLocator
  4. Set theLocator = CreateObject("WbemScripting.SWbemLocator")
  5. If Err <> 0 Then
  6. Wscript.Echo "CreateObject Error : " & Err.Description
  7. End if
  8. Dim theService
  9. Set theService = theLocator.ConnectServer( "outsoft9", "root\cimv2", "redmond\stevm", "wmidemo_2000")
  10. If Err <> 0 Then
  11. Wscript.Echo theEventsWindow.value & "ConnectServer Error : " & Err.Description
  12. End if
  13. theService.Security_.impersonationLevel = 3
  14. for each machine in theService.InstancesOf ("Win32_OperatingSystem")
  15. machine.Win32ShutDown(6)
  16. If Err <> 0 Then
  17. Wscript.Echo "CreateObject Error : " & Err.Description
  18. End if
  19. next