WMI and Network Adapters: 4
Posted by: Richard Siddaway
We have looked at using Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration.
Get-WmiObject -Class Win32_NetworkAdapter -Filter "NetEnabled=’$true’" |
Format-List NetConnectionID, Description, MACAddress, Speed
Get-WmiObject -Class Win32_NetworkAdapterConfiguration |
where {$_.IPAddress} | Foreach { $_.Description; $_ |
select -ExpandProperty IPAddress}
Now we need to look at combining the information from the two classes. One way to do it is like this
|
001
002 003 004 005 006 007 008 009 010 011 012 |
Get-WmiObject -Class Win32_NetworkAdapter -Filter "NetEnabled=’$true’" |
foreach { $_ | Format-List NetConnectionID, Description, MACAddress, Speed $filt = "Index=’" + $_.DeviceID + "’" |
This doesn’t give the most elegant of results so we will need to refine what we are doing




