Identify Internet connected NIC

This topic contains 2 replies, has 2 voices, and was last updated by  Vern Anderson 4 years, 2 months ago.

  • Author
    Posts
  • #8532

    Vern Anderson
    Participant

    Does anyone know of a 2012 NIC property that is the equivalent of GUI ncpa.cpl Network Connections "Internet Access"? I'm trying to use that property in a PowerShell script to identify the NIC that I want to make changes to.

     

    When you look at Network Neighborhood (ncpa.cpl) (yes I still call it that) and change the view to detailed view there's a column that displays "Connectivity" and the NIC I call public has Internet access. Thanks in advance!

    -VERN

  • #8536

    Richard Siddaway
    Moderator

    Check the Get-NetConnectionProfile cmdlet in the NetConnection module. It will show data like this:

    Name : NetworkName
    InterfaceAlias : AdapterName
    InterfaceIndex : 12
    NetworkCategory : Private
    IPv4Connectivity : Internet
    IPv6Connectivity : LocalNetwork

    Please let me know if you need any more help with this

  • #8538

    Vern Anderson
    Participant

    This is perfect!

    Thank you very much Richard!!!

    Here's the final script:

    $PublicInterface = Get-NetConnectionProfile -IPv4Connectivity Internet | Select-Object -ExpandProperty InterfaceAlias

    Rename-NetAdapter -Name $PublicInterface -NewName "Public"

     

You must be logged in to reply to this topic.