ManagementClass::GetRelatedClasses Method (String^, String^, String^, String^, String^, String^, EnumerationOptions^)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Retrieves classes related to the WMI class based on the specified options.

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

ManagementObjectCollection^ GetRelatedClasses(
	String^ relatedClass,
	String^ relationshipClass,
	String^ relationshipQualifier,
	String^ relatedQualifier,
	String^ relatedRole,
	String^ thisRole,
	EnumerationOptions^ options


Type: System::String^

The class from which resulting classes have to be derived.

Type: System::String^

The relationship type which resulting classes must have with the source class.

Type: System::String^

This qualifier must be present on the relationship.

Type: System::String^

This qualifier must be present on the resulting classes.

Type: System::String^

The resulting classes must have this role in the relationship.

Type: System::String^

The source class must have this role in the relationship.

Type: System.Management::EnumerationOptions^

The options for retrieving the resulting classes.

Return Value

Type: System.Management::ManagementObjectCollection^

A collection of classes related to this class.

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 uses the GetRelatedClasses method to list the related classes to the CIM_LogicalDisk class. For more information, see "CIM_LogicalDisk" in the Windows Management Instrumentation documentation in the MSDN Library at

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

.NET Framework
Available since 1.1
Return to top