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:
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!