Windows Vista Forums

How to rename enabled nics?
  1. #1


    gn!uz Guest

    How to rename enabled nics?

    I'm in desperate need of a script which allows me to rename the enabled nics...
    In my case Local Area Connection 5 (Network team) must be renamed to Public
    and 2 other active nics (member) should be renamed to Member #1 and Member #2.

    I thought the script was good to go but unfortunately the only thing missing
    is to write the new value into NetConnectionID..

    Any help is greatly appreciated! Many thanks


    strComputer = "."



    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set colNetAdapters = objWMIService.ExecQuery _
    ("Select * from Win32_NetworkAdapter where NetEnabled=TRUE")

    For Each objItem In colNetAdapters
    i = i + 1
    If objItem.NetConnectionID = "Local Area Connection 5" Then
    objItem.NetConnectionID = "Public"
    Else
    If Left(objItem.NetConnectionID,5) = "Local" Then
    objItem.NetConnectionID = "Team Member #" & i
    End If
    End If
    Next




    --
    // Freedom is a road seldom travelled by the multitude

      My System SpecsSystem Spec

  2. #2


    esska Guest

    Re: How to rename enabled nics?

    WMI don't have a set method to change NetConnectionID

    documentation:
    http://msdn.microsoft.com/en-us/libr...16(VS.85).aspx

    NetConnectionID
    Data type: string
    Access type: Read/write

    Name of the network connection as it appears in the Network
    Connections Control Panel program.

    Windows Server 2003 and Windows XP: This property is read-
    only.

    Windows 2000 and Windows NT 4.0: This property is not
    available.


    Have you tried to find it in powershell ?
    or to change registry?
    http://windowsitpro.com/article/arti...-registry.html








      My System SpecsSystem Spec

How to rename enabled nics? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set up 3 NICs on VPC? Gene. Virtual PC 5 03 Dec 2008
Script Must Be Enabled Error But It Is Enabled Dell Boy Vista General 3 03 Nov 2008
Rename errorin Vista - multiple file rename James136 Vista file management 3 04 Apr 2008
2 NICs Payge Vista networking & sharing 1 29 Jul 2007