Does anyone know how to call Win32Shutdown method of Win32_OperatingSystem class.

Here is what I have got so far:

VB Code:
  1. Dim OSClass As New ManagementClass("Win32_OperatingSystem")
  2.  
  3.         ' Get an input parameters object for this method
  4.         Dim inParams As ManagementBaseObject = processClass.GetMethodParameters("Win32Shutdown")
  5.  
  6.         ' Fill in input parameter values
  7.         inParams("Flags") = 2
  8.        
  9.         ' Execute the method
  10.         Dim outParams As ManagementBaseObject = processClass.InvokeMethod("Win32Shutdown", inParams, Nothing)

I got an error 'invalid method Parameter(s)' when it reached the last line InvokeMethod. What I want to do is just to shutdown the machine using VB.NET.