I'm writing a utility to shut down remote workstations. In order to
send a message to the user, I'd like to use the Win32ShutdownTr acker
method. However, I receive this error message:
"This method is not implemented in any class."
Here's my code:
Try
Dim scope As New
Management.Mana gementScope("\\ RemoteServer\ro ot\cimv2")
scope.Options.E nablePrivileges = True
scope.Connect()
Dim objQuery As New System.Manageme nt.ObjectQuery( "SELECT *
FROM Win32_Operating System")
Dim objSearcher As New
Management.Mana gementObjectSea rcher(scope, objQuery)
Dim objCol As Management.Mana gementObjectCol lection =
objSearcher.Get ()
Dim mo As Management.Mana gementObject
For Each mo In objCol
Dim methodArgs As String() = {"10", "Testing... ", "1", "6"}
mo.InvokeMethod ("Win32Shutdown Tracker", methodArgs) ' Error
occurrs here
Console.WriteLi ne(mo.ToString( ))
Next
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Cri tical)
End Try
I assume that the problem lies in methodArgs, but can't figure out what
it might be. The Win32Shutdown method works without a problem (in that
case, methodArgs = {"6", "0"}).
Thanks in advance!
Kombu
send a message to the user, I'd like to use the Win32ShutdownTr acker
method. However, I receive this error message:
"This method is not implemented in any class."
Here's my code:
Try
Dim scope As New
Management.Mana gementScope("\\ RemoteServer\ro ot\cimv2")
scope.Options.E nablePrivileges = True
scope.Connect()
Dim objQuery As New System.Manageme nt.ObjectQuery( "SELECT *
FROM Win32_Operating System")
Dim objSearcher As New
Management.Mana gementObjectSea rcher(scope, objQuery)
Dim objCol As Management.Mana gementObjectCol lection =
objSearcher.Get ()
Dim mo As Management.Mana gementObject
For Each mo In objCol
Dim methodArgs As String() = {"10", "Testing... ", "1", "6"}
mo.InvokeMethod ("Win32Shutdown Tracker", methodArgs) ' Error
occurrs here
Console.WriteLi ne(mo.ToString( ))
Next
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Cri tical)
End Try
I assume that the problem lies in methodArgs, but can't figure out what
it might be. The Win32Shutdown method works without a problem (in that
case, methodArgs = {"6", "0"}).
Thanks in advance!
Kombu
Comment