Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

ManagementBaseObject.Item Property (String)


Gets access to property values through [] notation. This property is the indexer for the ManagementBaseObject class. You can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

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

public object this[
	string propertyName
] { get; set; }


Type: System.String

The name of the property of interest.

Property Value

Type: System.Object

Returns an Object value that contains the management object for a specific class property.

An object instance that contains the value of the requested property.

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 shows how to initialize a ManagementClass variable with a ManagementClass constructor and then get all the instances of a WMI class.

using System;
using System.Management;

public class Sample 
    public static void Main() 
        ManagementClass c = new ManagementClass("Win32_Process");
        foreach (ManagementObject o in c.GetInstances())
                "Next instance of Win32_Process : {0}", o["Name"]);


.NET Framework
Available since 1.1
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft