Home All Groups Group Topic Archive Search About

Win32ShutdownTracker error

Author
14 Mar 2006 4:29 PM
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

Author
14 Mar 2006 6:03 PM
Herfried K. Wagner [MVP]
<komb***@hotmail.com> schrieb:
> 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".

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
16 Mar 2006 1:01 AM
kombu67
Herfried,

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