WMI - get single attribute

  • Thread starter Thread starter GC
  • Start date Start date
G

GC

Hi,
All the examples of getting WMI information shows using a foreach loop to
loop though multiple entries, like to more than one IP address, etc. If I
just want to get the value for single value attributes, like "Manufacturer"
in SELECT * FROM Win32_ComputerSystem, how would I get that value? This is
the Searcher string that I'm using. Thanks!

ManagementObjectSearcher MOSSearcher = new ManagementObjectSearcher("SELECT
* FROM Win32_ComputerSystem");
 
GC said:
Hi,
All the examples of getting WMI information shows using a foreach loop to
loop though multiple entries, like to more than one IP address, etc. If I
just want to get the value for single value attributes, like
"Manufacturer" in SELECT * FROM Win32_ComputerSystem, how would I get that
value? This is the Searcher string that I'm using. Thanks!

ManagementObjectSearcher MOSSearcher = new
ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem");
Basic SQL syntax...

SELECT Manufacturer FROM Win32_ComputerSystem

Willy.
 
Back
Top