Windows Vista Forums

How to list ethernet adaptors by name (Local Area Connection name)
  1. #11


    pschmidt Guest

    Re: How to list ethernet adaptors by name (Local Area Connection n

    Brilliant!!

    And thanks to Alex's post a little later, found 'Name' on the NetworkAdaptor
    which is what I wanted - mapping from netconnectionid to name - once I know
    what the objects call them

    > gwmi win32_NetworkAdapter -filter "netconnectionid is not null" | select netconnectionid,Name | ft -auto
    netconnectionid Name
    --------------- ----
    Enterprise Broadcom BCM5708S NetXtreme II GigE (NDIS VBD Client)
    Private Broadcom BCM5708S NetXtreme II GigE (NDIS VBD Client) #2


    Now I have to figure how this power-shell stuff. First time using it. Yet
    anoter scripting language to learn

    Thanks for all the help folks.

    Perry





    "Shay Levy [MVP]" wrote:

    > Hi pschmidt,
    >
    > It's a combination on two WMI calls (I'm sure one can merge them into one):
    >
    >
    >
    > PS > gwmi Win32_NetworkAdapter -filter "netconnectionid is not null"| select
    > netconnectionid,interfaceindex | ft -auto
    >
    >
    > netconnectionid interfaceindex
    > --------------- --------------
    > Local Area Connection 10
    > Bluetooth Network Connection 13
    > Wireless Network Connection 14
    > Local Area Connection 19
    >
    >
    >
    >
    > Now you can issue a second WMI call to the interface you need:
    >
    > PS > gwmi Win32_NetworkAdapterConfiguration -filter "interfaceindex=10"
    >
    > DHCPEnabled : True
    > IPAddress :
    > DefaultIPGateway :
    > DNSDomain :
    > ServiceName : e1express
    > Description : Intel(R) 82566MM Gigabit Network Connection
    > Index : 4
    >
    >
    >
    > ---
    > Shay Levy
    > Windows PowerShell MVP
    > http://blogs.microsoft.co.il/blogs/ScriptFanatic
    >
    >
    >
    > p> I'm trying to find a way to list the network adapter information
    > p> based on the ethernet adapter as listed by ipconfig - the 'defaults'
    > p> are 'Local Area Connection', Local Area Connection 2', etc...
    > p>
    > p> I've found lots of info using Win32_NetworkAdapterConfiguration, and
    > p> this gets me most of what I want. But I can't find the 'name' in
    > p> this object. How do I get this name? Or is there a way I can get
    > p> the NICs Win32_NetworkAdapterConfiguration object with the given
    > p> name. Either will work with with I'm doing.
    > p>
    > p> Thx,
    > p>
    > p> Perry
    > p>
    >
    >
    >

      My System SpecsSystem Spec

  2. #12


    pschmidt Guest

    RE: How to list ethernet adaptors by name (Local Area Connection n


    Sorry - I'm an idiot - netconnecitonid, not networkconnectionid.

    That works great....duh.

    "pschmidt" wrote:

    >
    > OK, now a basic question on Powershell. Thanks to all the replies I got
    > this - and works great:
    >

    > > gwmi win32_NetworkAdapter -filter "NetConnectionID is not null" | select netconnectionid,Name | ft -auto
    >
    > netconnectionid Name
    > --------------- ----
    > Enterprise Broadcom BCM5708S NetXtreme II GigE (NDIS VBD Client)
    > Private Broadcom BCM5708S NetXtreme II GigE (NDIS VBD Client) #2
    >
    > ------------------------------------
    >
    > How do I write the filter to say netconnectionid = Enterprise??
    >
    > I tried the obvious:
    >

    > > gwmi win32_NetworkAdapter -filter "NetConnectionID=enterprise" | select netconnectionid,Name | ft -auto
    >
    > Get-WmiObject : Invalid query
    > At line:1 char:5
    > + gwmi <<<< win32_NetworkAdapter -filter "NetConnectionID=enterprise" |
    > select
    > netconnectionid,Name | ft -auto
    >
    > -----------------
    >
    > Obviously doesn't work. Sorry - this powershell stuff is new to me...
    >
    > Thx,
    >
    > Perry
    >
    >

      My System SpecsSystem Spec

Page 2 of 2 FirstFirst 12
How to list ethernet adaptors by name (Local Area Connection name) problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
ethernet connection problem. local only kmonie360 Network & Sharing 1 16 Feb 2010
Local Area Connection 2 Wandering Flame Network & Sharing 1 06 Nov 2009
local area connection cortesmex Network & Sharing 1 07 Feb 2009
Local Area Connection Must Be Reset Jay Cee Vista performance & maintenance 0 14 Jul 2008
Local Area Connection > Local Only Phil H. Vista networking & sharing 3 28 Jan 2008