How to get a count of ManagementObjects (WMI results) without enumerating through the collection in

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-04-22T17:20:06Z Indexed on 2010/04/22 17:23 UTC
Read the original article Hit count: 239

Filed under:
|
|
|
|

When querying for large ammount of data through WMI (say the windows events log Win32_NTLogEvent) it is very useful to know what kind of numbers you are getting yourself into before downloading all the content. Is there a way two do this?

From what i know there is no "Select Count(*) FROM Win32_NTLogEvent" in WQL.

From what i know the Count property of the ManagementObjectCollection actually enumerates through all the results whether you have the Rewindable property set to true or false.

If it cannot be done in .NET, can it be done by directly using the underlying IWbem objects Thanks

© Stack Overflow or respective owner

Related posts about wmi

Related posts about .NET