Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - How to rename enabled nics?

Reply
 
Old 10-29-2008   #1 (permalink)
gn!uz


 
 

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
Old 10-30-2008   #2 (permalink)
esska


 
 

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
Reply

Thread Tools


Similar Threads
Thread Forum
How to set up 3 NICs on VPC? Virtual PC
Script Must Be Enabled Error But It Is Enabled Vista General
Rename errorin Vista - multiple file rename Vista file management
2 NICs Vista networking & sharing
multiple NICs Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46