I'm looking to get the Bytes per/sec from a specific NIC, right now i'm
pulling BytesTotalPersec from
Win32_PerfFormattedData_TCPIP_NetworkInterface. This works great, but it
brings back all NICs, how do i choose which NIC I want?

My code is:

Set ColItems = objWMIService.ExecQuery("Select BytesTotalPersec from
Win32_PerfFormattedData_TCPIP_NetworkInterface")
For Each objItems in colItems
Wscript.Echo "Network Bandwidth: " & objItems.BytesTotalPersec

Next

Thanks

Glenn

RE: WMI Getting Network Bandwidth for Specific NIC by JKillean

JKillean
Wed Jan 26 10:09:04 CST 2005

Do a filter on the .name property.

Set wmiColl = wmiRoot.ExecQuery("Select * FROM
Win32_PerfRawData_Tcpip_NetworkInterface where name='Network Connection
Name'")
For Each objItems in colItems
Wscript.Echo "Network Bandwidth: " & objItems.BytesTotalPersec
Next


"G Leifheit" wrote:

> I'm looking to get the Bytes per/sec from a specific NIC, right now i'm
> pulling BytesTotalPersec from
> Win32_PerfFormattedData_TCPIP_NetworkInterface. This works great, but it
> brings back all NICs, how do i choose which NIC I want?
>
> My code is:
>
> Set ColItems = objWMIService.ExecQuery("Select BytesTotalPersec from
> Win32_PerfFormattedData_TCPIP_NetworkInterface")
> For Each objItems in colItems
> Wscript.Echo "Network Bandwidth: " & objItems.BytesTotalPersec
>
> Next
>
> Thanks
>
> Glenn

Re: WMI Getting Network Bandwidth for Specific NIC by McKirahan

McKirahan
Wed Jan 26 10:23:21 CST 2005

"JKillean" <JKillean@discussions.microsoft.com> wrote in message
news:5F71B84B-68EB-4D4E-86CB-1C0ADD1DE323@microsoft.com...
> Do a filter on the .name property.
>
> Set wmiColl = wmiRoot.ExecQuery("Select * FROM
> Win32_PerfRawData_Tcpip_NetworkInterface where name='Network Connection
> Name'")
> For Each objItems in colItems
> Wscript.Echo "Network Bandwidth: " & objItems.BytesTotalPersec
> Next

[snip]

Shouldn't
Set wmiColl
be
Set colItems



RE: WMI Getting Network Bandwidth for Specific NIC by Paul

Paul
Thu Mar 03 19:31:03 CST 2005

Glenn,

I have an identical problem except that the computer I'm looking at has 2
network cards with the same name. Wouldn't it be nice if there was a MAC
Address field in this table? If you found a way around this dilemma, then I'd
love to hear it.

Regards,
Paul.


"G Leifheit" wrote:

> I'm looking to get the Bytes per/sec from a specific NIC, right now i'm
> pulling BytesTotalPersec from
> Win32_PerfFormattedData_TCPIP_NetworkInterface. This works great, but it
> brings back all NICs, how do i choose which NIC I want?
>
> My code is:
>
> Set ColItems = objWMIService.ExecQuery("Select BytesTotalPersec from
> Win32_PerfFormattedData_TCPIP_NetworkInterface")
> For Each objItems in colItems
> Wscript.Echo "Network Bandwidth: " & objItems.BytesTotalPersec
>
> Next
>
> Thanks
>
> Glenn