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
23 lines
673 B
On Error Resume Next
|
|
|
|
' Create the Locator
|
|
Dim theLocator
|
|
Set theLocator = CreateObject("WbemScripting.SWbemLocator")
|
|
If Err <> 0 Then
|
|
Wscript.Echo "CreateObject Error : " & Err.Description
|
|
End if
|
|
|
|
Dim theService
|
|
Set theService = theLocator.ConnectServer( "outsoft9", "root\cimv2", "redmond\stevm", "wmidemo_2000")
|
|
If Err <> 0 Then
|
|
Wscript.Echo theEventsWindow.value & "ConnectServer Error : " & Err.Description
|
|
End if
|
|
|
|
theService.Security_.impersonationLevel = 3
|
|
|
|
for each machine in theService.InstancesOf ("Win32_OperatingSystem")
|
|
machine.Win32ShutDown(6)
|
|
If Err <> 0 Then
|
|
Wscript.Echo "CreateObject Error : " & Err.Description
|
|
End if
|
|
next
|