Version User Scope of changes
Oct 26 2009, 8:00 PM EDT (current) RyanW-Dell 51 words added
Oct 23 2009, 5:28 PM EDT RyanW-Dell

Changes

Key:  Additions   Deletions
Disclaimer: These scripts have undergone very limited testing and are not officially supported by Dell.


Rename Adapters to their MAC Addresses

This script will take any adapters that begin with the name "Local Area Connection" and rename them to their MAC addresses. This can be extremely useful in a blade server environment where performing the mappings from physical adapter to logical adapter can be tedious. If you are running a blade environment, check out the post on the blade configuration setup in Virtualization Solutions Engineering lab that details a sample deployment(http://www.delltechcenter.com/page/Hyper-V+R2+Lab+Configuration).

To execute, copy the contents below into a batch file and run it.


@echo off&Title=Set Adapter Names &MODE CON: COLS=100 LINES=20
powershell -nologo -command "Write-Host 'Attempting to rename adapters named Local Area Connection* to their MAC address'; $Shell = New-Object -com shell.application; $NetCons = $Shell.Namespace(0x31); $NetCons.Items() | where {$_.Name -like 'Local Area Connection*'} | foreach{$AdapName=$_.Name; get-WmiObject -class Win32_NetworkAdapter| where-Object {$_.NetConnectionID -eq $AdapName} | foreach {$MAC=$_.MacAddress}; Write-Host Renaming $_.Name to $MAC; $_.Name=$MAC.replace(':','.')}" | more
pause

Before:


Network Connections Default Naming

After:


Network Connections - Renamed to MAC