Msndis class
The MSNdis class from the root\wmi namespace calls the MSNdis_CoHardwareStatus and MSNdis_CoDriverVersion classes. On my Windows 7 system it tries to call something else but I get a “Get-WmiObject : Not supported” error. Neither of these classes seems to have much in the way of documentation available.
Rather than calling MSNdis and getting a lot of WMI objects it would be better to combine the output. There are a set of MSNdis-co* classes
gwmi -Namespace root\wmi -List *ndis_co* | sort name
MSNdis_CoDriverVersion
MSNdis_CoHardwareStatus
MSNdis_CoLinkSpeed
MSNdis_CoMacOptions
MSNdis_CoMediaConnectStatus
MSNdis_CoMediaInUse
MSNdis_CoMediaSupported
MSNdis_CoMinimumLinkSpeed
MSNdis_CoReceivePduErrors
MSNdis_CoReceivePdusNoBuffer
MSNdis_CoReceivePdusOk
MSNdis_CoTransmitPduErrors
MSNdis_CoTransmitPdusOk
MSNdis_CountedString
MSNdis_CoVendorDescription
MSNdis_CoVendorDriverVersion
MSNdis_CoVendorId
Lets see what we can find out about them
function get-adaptercoinfo {
param(
[string]$computer="."
)
Get-WmiObject -Namespace root\wmi -Class MSNdis_CoHardwareStatus `
-ComputerName $computer |
foreach {
$drv = Get-WmiObject -Namespace root\wmi `
-Class MSNdis_CoDriverVersion -ComputerName $computer `
-Filter "InstanceName='$($_.InstanceName)'"
New-Object -TypeName PSobject -Property @{
Computer = $_.__SERVER
Adapter = $_.InstanceName
Active = $_.Active
HardwareStatus = $_.NdisCoHardwareStatus
DriverVersion = $drv.NdisCoDriverVersion
}
}
}
Start with the MSNdis_CoHardwareStatus and match to MSNdis_CoDriverVersion on instance name (associators don’t seem to be created for these classes). Put the appropriate properties into an object and output.
The output is best displayed like this
get-adaptercoinfo | ft -a