Win32ShutdownTracker error

K

kombu67

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 Win32ShutdownTracker
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.ManagementScope("\\RemoteServer\root\cimv2")

scope.Options.EnablePrivileges = True
scope.Connect()

Dim objQuery As New System.Management.ObjectQuery("SELECT *
FROM Win32_OperatingSystem")
Dim objSearcher As New
Management.ManagementObjectSearcher(scope, objQuery)
Dim objCol As Management.ManagementObjectCollection =
objSearcher.Get()
Dim mo As Management.ManagementObject

For Each mo In objCol

Dim methodArgs As String() = {"10", "Testing...", "1", "6"}

mo.InvokeMethod("Win32ShutdownTracker", methodArgs) ' Error
occurrs here
Console.WriteLine(mo.ToString())

Next

Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
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
 
H

Herfried K. Wagner [MVP]

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 Win32ShutdownTracker
method. However, I receive this error message:

"This method is not implemented in any class."

Note that this method is only supported on Windows Vista/Windows Server
"Longhorn".
 
K

kombu67

Herfried,

Thanks for your reply. Can you recommend a different method to
accomplish the same thing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top