Searching for Objects

Although object paths provide a convenient way of unambiguously identifying an object or class, their use is restricted to situations in which you know the name of the class and the key properties of the object you are looking for. Although many management tasks require nothing more, suppose, for example, that you have disk space problems on your file server, and you want to compress all files that are larger than approximately 10 MB. If you could get references to WMI objects representing each such uncompressed file, you could use the compress action defined by the CIM_DataFile class to perform the compression.

Asking the Object Manager to return references to all these objects would clearly require more than an object ...

Get Windows Management Instrumentation (WMI) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.