"SherTeks" <> wrote in message
news:24440D9D-CB44-4BAB-8E16-...
>
>
> "Pegasus (MVP)" wrote:
>
>>
>> "SherTeks" <> wrote in message
>> news:6D254F68-839B-4F91-89A9-...
>> > Hi,
>> >
>> > The following WMI query executes fine and outputs the Processor details
>> >
>> > 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
>> >
>> > 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
>>
>> Maybe I'm missin the point in your question but why don't you simply
>> continue along the same lines in your code?
>>
>> Set objWMIService = GetObject("winmgmts:" _
>> & "{impersonationLevel=impersonate}!\\.\root\cim v2")
>> 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
>>
>> Set colBIOS = objWMIService.ExecQuery _
>> ("Select * from Win32_BIOS")
>>
>> For Each objItem In colBIOS
>> WScript.Echo "BIOS Manufacturer: " & objItem.Manufacturer
>> WScript.Echo "BIOS Details:"
>> For i = 0 To UBound(objItem.BIOSVersion)
>> WScript.Echo " " & objItem.BIOSVersion(i)
>> Next
>> Next
>>
>>
>> Hi,
>
> Thanks for the reply.
> Yes, I knew this could be done.
> But, I was looking for some other way (or some other WMI query) which
> would
> actually package more than one queries ie. no more multiple ExecQuery(..)
> or
> For loops.
>
> May be some WMI query which works like snmpbulkget command which actually
> gets all available details and the required details could be later parsed.
>
> Thanks again.
There is no more efficient way to retrieve the information. I know of no way
to combine the queries.
--
Richard Mueller
MVP Directory Services
Hilltop Lab -
http://www.rlmueller.net
--