Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Right now, I am getting two separate objects

  1. A Win32_NetworkAdapter WMI object
  2. A Win32_PnpSignedDriver WMI object

In my previous scripts, I've made sure I was calling separate objects, and relating them by the GUID

     $mydev = Get-WmiObject -class Win32_NetworkAdapter | Where-Object {$_.pnpdeviceid -like "*VEN_0000&DEV_00AA*"}

     If ($mydev.GUID -eq $relatedobj.ParentID)
     {
         action
     }

But there is no GUID/ParentID/etc. property for a Win32_PnpSignedDriver object. Is there another way to obtain information about a device's drivers (specifically, the driver version), and also obtain the GUID of the device? Is it possible to do this win the Win32_PnpSignedDriver, and I'm just not seeing it?

share|improve this question

1 Answer 1

I found an easy way around this. I'm not great with the registry, so it was the last place I looked; but using it makes it much easier to find the information I was looking for.

I compare the nic information the same way as in my original post (with the Win32_NetworkAdapter WMI object), but I compare the GUID to the registry value instead. This can be done using the following line to get all nics:

    $nicreg = Get-ChildItem -path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\" -ErrorAction SilentlyContinue

    foreach ($nic in $nicreg)
    {
        # do stuff with driver versions
    }

And then iterating through each NIC comparing $nic.GetValue("NetCfgInstanceId") to $mydev.GUID. After you have confirmed you are looking at the right nic by verifying the GUID, you can get $nic.GetValue("DriverVersion") for the device you are looking at.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.