Quantcast
Channel: PeetersOnline.nl » NIC
Viewing all articles
Browse latest Browse all 3

Gather NIC properties (including Speed and Duplex)

$
0
0

Gathering all sorts of server information with Powershell is rather easy, using the Get-WmiObject cmdlet.

In order to get NIC settings, the following little script returns a LOT of information:

$serverName = Read-Host “Enter server name”
$NicConfig = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -ComputerName $serverName
$NicConfig | Format-List *

The one thing I was missing though, is the value of the NIC Speed and Duplex. So I started to dig into the registry and found a way to discover these values.
The following key holds the information I’m looking for:

HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}

The subkeys are named after the ID’s of the different NICs, so I can match them against the SettingId property of the Wmi output. Now the trick is in identifying what vendor/model the NIC (or at least the chip) is. That’s because every rband will have the Speed / Duplex setting stored in a different key. Also, the values of that key are illegible, and the translation to readable output is stored in even different subkeys. That’s to keep things simple :|

Lucky for you, I have already figured out a way to decypher all this and the following script has the information for the three most frequently used brands embedded. So, download, rename to .ps1 and have fun!

Get-NICSettings (rename to .ps1)


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles



Latest Images