PowerShell script to get NIC card type

Recently we came across a issue with a set version of NICs on our network. SCCM gave us a overview of machines that needed some settings changes. This script came in handy to query specific machines.


Param($computer)

if($computer){
 Write-Host -foregroundcolor green "Network connections for $computer"
 Get-WmiObject win32_networkadapter -computerName $computer -filter "NetConnectionStatus = 2" | Format-Table Name, NetEnabled, DeviceId -auto
}
else{
 Write-Host -foregroundcolor green "Network connections this machine"
 Get-WmiObject win32_networkadapter -computerName localhost -filter "NetConnectionStatus = 2" | Format-Table Name, NetEnabled, DeviceId -auto
}