Initialize an EnumerationOptions variable with an EnumerationOptions constructor and then gets all the instances of a WMI class and its subclasses. : Management « Windows « VB.Net Tutorial






Imports System
Imports System.Management
Public Class RemoteConnect

    Public Overloads Shared Function Main(ByVal args() As String) As Integer
        Dim opt As New EnumerationOptions
        opt.EnumerateDeep = True
        Dim mngmtClass As New ManagementClass("CIM_Service")
        Dim o As ManagementObject
        For Each o In mngmtClass.GetInstances(opt)
            Console.WriteLine(o("Name"))
        Next o

        Return 0
    End Function
End Class








24.29.Management
24.29.1.Initialize an EnumerationOptions variable with an EnumerationOptions constructor and then gets all the instances of a WMI class and its subclasses.
24.29.2.Connect to a remote computer and displays information about the operating system on the remote computer.
24.29.3.Notification when an instance of Win32_Process is created
24.29.4.Synchronous consumption of events. The client is blocked while waiting for events.