ManagementObjectCollection ManagementObjectCollection ManagementObjectCollection ManagementObjectCollection Class


Represents different collections of management objects retrieved through WMI. The objects in this collection are of ManagementBaseObject-derived types, including ManagementObject and ManagementClass. The collection can be the result of a WMI query executed through a ManagementObjectSearcher, or an enumeration of management objects of a specified type retrieved through a ManagementClass representing that type. In addition, this can be a collection of management objects related in a specified way to a specific management object - in this case the collection would be retrieved through a method such as GetRelated(). The collection can be walked using the ManagementObjectCollection.ManagementObjectEnumerator and objects in it can be inspected or manipulated for various management tasks.

public ref class ManagementObjectCollection : IDisposable, System::Collections::ICollection
public class ManagementObjectCollection : IDisposable, System.Collections.ICollection
type ManagementObjectCollection = class
    interface ICollection
    interface IEnumerable
    interface IDisposable
Public Class ManagementObjectCollection
Implements ICollection, IDisposable


Count Count Count Count

Gets a value indicating the number of objects in the collection.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

Gets a value indicating whether the object is synchronized.

SyncRoot SyncRoot SyncRoot SyncRoot

Gets the object to be used for synchronization.


CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

Copies the collection to an array.

CopyTo(ManagementBaseObject[], Int32) CopyTo(ManagementBaseObject[], Int32) CopyTo(ManagementBaseObject[], Int32) CopyTo(ManagementBaseObject[], Int32)

Copies the items in the collection to a ManagementBaseObject array.

Dispose() Dispose() Dispose() Dispose()

Releases resources associated with this object. After this method has been called, an attempt to use this object will result in an ObjectDisposedException being thrown.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

Disposes of resources the object is holding. This is the destructor for the object. Finalizers are expressed using destructor syntax.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns the enumerator for the collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

Returns an IEnumerator that iterates through the ManagementObjectCollection.

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to