Microsoft.Management.Infrastructure Namespace - Cim Classes

I use new classes Microsoft.Management.Infrastructureto handle WMI, but I ran into a stumbling block and cannot find any information on how to get around this using these classes without giving up on using it System.Management.ManagementObject.

In principle, it Microsoft.Management.Infrastructuredoes not provide any methods for objects, with which I have difficulties.

I got the object CimClass, called it Win32_Process, named the property .CimClassProperties["Handle"]to get the property Handleand .Qualifiersto get a list of qualifiers for the property Handle.

At this point, I would like to remove one of the qualifiers, but there are no methods available that allow such a thing.

Using the namespace Microsoft.Management.ManagementObject, I could get the object ManagementClass, again Win32_Processfor the sake of argument, call .Properties["Handle"].Qualifiers.Remove(<qualifierName>)to remove the determinant, but I don’t know how to do it using the new classes and there is no information that I can find.

EDIT . I searched a bit and found that I used a class CimSessionusing methods to call methods on CIM objects, CimSession.InvokeMethodor CimSession.InvokeMethodAsyncwas able to use it to call a method CimClassand CimInstance, but it doesn’t seem to be able to refer to methods of any object outside of these two, from what I see. It's me?

+4
source share
2 answers

, . , . , - , .

enter image description here

0

Source: https://habr.com/ru/post/1584342/


All Articles