I was afraid from WMI

Until I found Microsoft (R) Management Strongly Typed Class Generator - MgmtClassGen.exe

Microsoft (R) Management Strongly Typed Class Generator Version 1.1.4322.573
Copyright c Microsoft Corporation 1998-2002. All rights reserved.
MgmtClassGen <WMIClass> [options]

         /N <WMINamespace>               WMI namespace containing the class. Defaults to root\cimv2
         /O <ClassNamespace>             .NET namespace in which the class is generated
         /L <Generated Language>         One of the following. Defaulted to CS
                                                 CS - CSharp(C#)
                                                 VB - Visual Basic
                                                 JS - JScript

         /P <FilePath>                   Output file path
         /M <Machine>                    Remote computer to connect. Defaults to the local machine
         /U <User>                       User name
         /PW <Password>                  Password
         /?                              Displays this help screen

Example :
        MgmtclassGen Win32_Logicaldisk /L VB /N root\cimv2 /P c:\temp\logicaldisk.vb

You can find it under you sdk bin directory, so instead of figuring out the properties of the objects you get a strongly type object to work with.

Skip to main content