Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ManagementClass Constructor (ManagementScope, ManagementPath, ObjectGetOptions)

ManagementClass Constructor (ManagementScope, ManagementPath, ObjectGetOptions)

Initializes a new instance of the ManagementClass class for the specified WMI class in the specified scope and with the specified options. The class represents a Common Information Model (CIM) management class from WMI such as Win32_LogicalDisk, which can represent a disk drive, and Win32_Process, which represents a process such as Notepad.exe. For more information, see "Win32 Classes" in the Windows Management Instrumentation documentation in the MSDN Library at http://msdn.microsoft.com/library.

Namespace:  System.Management
Assembly:  System.Management (in System.Management.dll)

new : 
        scope:ManagementScope * 
        path:ManagementPath * 
        options:ObjectGetOptions -> ManagementClass

Parameters

scope
Type: System.Management.ManagementScope

A ManagementScope that specifies the scope (server and namespace) where the WMI class resides.

path
Type: System.Management.ManagementPath

A ManagementPath that represents the path to the WMI class in the specified scope. The class represents a CIM management class from WMI. CIM classes represent management information including hardware, software, processes, and so on. For more information about the CIM classes available in Windows, see "Win32 classes" in the Windows Management Instrumentation documentation in the MSDN Library at http://msdn.microsoft.com/library.

options
Type: System.Management.ObjectGetOptions

An ObjectGetOptions that specifies the options to use when retrieving the WMI class.

The path can be specified as a full path (including server and namespace). However, if a scope is specified, it will override the first portion of the full path.

.NET Framework Security

Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.

The following example is an example of how to initialize a ManagementClass variable with a ManagementClass constructor. The example lists the methods, properties, and qualifiers (including the amended qualifiers) for the created class. You must change the scope (namespace) in the code for the example to run correctly on your computer.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft