Re: Fetching 2 NIC values only
- From: "Tory Collum" <ToryCollum@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 23 May 2005 08:17:04 -0700
The Exit For is there because I don't know how to display 2 categories only.
Exit For of course just cuts the display to show the first value. My Windows
2003 Server has two physical NIC's and that's all I want to display. There
are some other items to that come up if I remove the Exit For, but they are
not useful to me.
I'm just looking for a way to enumerate the first two values only...
"Torgeir Bakken (MVP)" wrote:
> Tory Collum wrote:
>
> > This script returns the first network card, but I actually have two network
> > cards on the machine, so my goal is to fetch the the first and second cards
> > (which I assume are 0 and 1)-what is the best way I can do that?
> >
> > Thank you
> >
> > sComputer = "."
> > sNameSpace = "root/CIMV2"
> > sClass = "Win32_NetworkAdapterConfiguration"
> > Set cInstances = GetObject("winmgmts:{impersonationLevel=impersonate}//" & _
> > sComputer & "/" & sNameSpace & ":" & sClass).Instances_
> > For Each oInstance In cInstances
> > WScript.Echo String(60,"=")
> > For Each oProperty In oInstance.Properties_
> > WScript.Echo oProperty.Name
> > If IsArray(oProperty) Then
> > For iCount = 0 To UBound(oProperty)
> > WScript.Echo vbTab & oProperty.Value(iCount)
> > Next
> > ElseIf IsNull(oProperty) Then
> > Wscript.Echo vbTab & "Property not set"
> > Else
> > WScript.Echo vbTab & oProperty.Value
> > End If
> > Next
> > Exit For
> > Next
> Hi,
>
> Remove the "Exit For" line and see if it gives you what you want.
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scriptcenter/default.mspx
>
.
- Follow-Ups:
- Re: Fetching 2 NIC values only
- From: Jim Vierra
- Re: Fetching 2 NIC values only
- References:
- Fetching 2 NIC values only
- From: Tory Collum
- Re: Fetching 2 NIC values only
- From: Torgeir Bakken \(MVP\)
- Fetching 2 NIC values only
- Prev by Date: Re: WMI from C#
- Next by Date: How to detect network Loss
- Previous by thread: Re: Fetching 2 NIC values only
- Next by thread: Re: Fetching 2 NIC values only
- Index(es):
Relevant Pages
|