How can I do a WMI Bulk data retrieval ?
Hi,
The following WMI query executes fine and outputs the Processor details
Code:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor")
For Each objItem in colItems
Wscript.Echo "Address Width: " & objItem.AddressWidth
Wscript.Echo "Architecture: " & objItem.Architecture
Wscript.Echo "Availability: " & objItem.Availability
Wscript.Echo "CPU Status: " & objItem.CpuStatus
Next
Now, I also want to execute the below query
Code:
Set colBIOS = objWMIService.ExecQuery _
("Select * from Win32_BIOS")
which would get BIOS details.
But, how can I execute both the query in one fell swoop ie. in a bulk.
Note : There is some snmp (protocol) command called snmpbulkget that actually fetches bulk data from a network entiry
with one command. Is there anything similar to this in WMI that fetches bulk data.
Thanks in Advance
Re: How can I do a WMI Bulk data retrieval ?
I haven't used WMI in a long time, but can you concatenate your queries? For example:
Code:
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor; Select * from Win32_BIOS")
EDIT - Nope - scratch that idea. I think the problem you're going to run into by doing this is the namespaces will collide - For example, the Processor namespace and the BIOS namespace could both have a Name object. You may just have to run multiple queries.
Re: How can I do a WMI Bulk data retrieval ?
Just to confirm this...
Yes, you are going to have to run two separate queries.