Sdílet prostřednictvím


Collecting Driver Version of the Wireless Network Adapter via Hardware Inventory

Update 11/11/2013: Russ Rimmerman just posted a ConfigMgr 2012 version of how to do this. You can read his blog post here.

Although the Configuration Manager Hardware Inventory Client Agent reports on approximately 1,500 hardware properties from almost 100 different WMI classes by default, there is always a time when you want MORE. One such scenario is when you’re looking to collect information about the Driver Version of the Wireless NIC or even the Wired NIC for that matter. This post specifically talks about reporting on the Wireless NIC Driver Version, however with some modifications to the query mentioned at the end, it is possible to report on the Driver Version of the Wired NIC as well.

Starting off with some research. By default, Network Adapter information is queried from Win32_NetworkAdapter Class within the root\cimv2 namespace, however none of the properties defined within this class talk about the Driver and hence it is not possible to collect this piece of information without having to extend the Hardware Inventory MOF Files. But before I even began to think about extending the MOF files, I needed to first know where is the Driver Version information stored. Now, while searching about this, I stumbled on this link which talks about getting this from Win32_PnPSignedDriver class. Only problem getting the Driver Version from here is that you may end up collecting a lot of information that is not required. So after searching some more, I found that Driver Version is also stored within the following Registry key:

HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}

Moreover, *MediaType DWORD value within each sub-key corresponding to each Network Adapter can also be used to identify a Wireless Adapter. Specifically, a decimal value of 16 of *MediaType would correspond to a Wireless Adapter. So after querying what’s required from each sub-key within this registry key, a custom report/collection can be created based on the *MediaType value to identify Wireless Driver Version.

On to the actual MOF editing now. This involves SMS_DEF.mof and Configuration.mof. Configuration.mof file is used to define the data classes to be inventoried by the hardware inventory client agent. In other words, if the data you need doesn’t already reside in WMI, you need to define it in form of a Data Class in Configuration.mof. SMS_DEF.mof defines the reporting classes to determine whether or not specific client Data Class information is reported. You can read more about these two files, here.

First off, defining the registry key and values by editing and adding the below section to the Configuration.mof file:

 #pragma namespace ("\\\\.\\root\\cimv2") 
  
 [ dynamic, 
  provider("RegProv"), 
  ClassContext("local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}") 
 ] 
 class Win32Reg_NetworkDrivers
 { 
    [key] 
        string    Index; 
    [PropertyContext("DriverDesc")] 
        string    DriverDesc; 
    [PropertyContext("DriverVersion")] 
        string    DriverVersion; 
    [PropertyContext("DriverDate")  ] 
        string    DriverDate; 
    [PropertyContext("*MediaType")  ] 
        string    MediaType; 
 };

Now, adding the following to the SMS_DEF.mof:

 #pragma namespace ("\\\\.\\root\\cimv2\\sms") 
  
 [ SMS_Report     (TRUE), 
  SMS_Group_Name ("Network Drivers"), 
  SMS_Class_ID   ("MICROSOFT|NETWORK_DRIVERS|1.0"), 
  Namespace      ("\\\\\\\\localhost\\\\root\\\\cimv2") ] 
  
 class Win32Reg_NetworkDrivers : SMS_Class_Template 
 { 
    [SMS_Report (TRUE), key ] 
        string Index; 
    [SMS_Report (TRUE)      ] 
        string DriverDesc; 
    [SMS_Report (TRUE)      ] 
        string DriverVersion; 
    [SMS_Report (TRUE)      ] 
        string DriverDate; 
    [SMS_Report (TRUE)      ] 
        string MediaType; 
 };

Once these changes are received on the clients in the form of a Policy, they will add the relevant Data and Report classes, which will then be reported by the Hardware Inventory Client Agent based on the Inventory Schedule.

Finally, to convert this into a Custom Report, following query can be used to run this report on a Collection to get a list of machines with Wireless Adapters (MediaType = 16), along with the Driver Version:

 SELECT RS.Netbios_Name0, NAD.DriverDesc0, NAD.DriverVersion0, NAD.DriverDate0
 FROM v_R_System RS
 INNER JOIN v_GS_NETWORK_DRIVERS NAD on NAD.ResourceId = RS.ResourceId
 INNER JOIN v_FullCollectionMembership FCM ON FCM.ResourceID = RS.ResourceID
 WHERE NAD.MediaType0 = 16 AND FCM.CollectionID = @CollectionID

where, CollectionID is the Prompt Name with the following SQL Statement:

 SELECT CollectionID, Name FROM v_Collection

OR, if you’re looking to make a custom collection based on a specific Network Adapter Driver Version, a WQL query similar to this can be used:

 SELECT SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client 
 FROM SMS_R_System 
 JOIN SMS_G_System_NETWORK_DRIVERS ON SMS_R_System.ResourceID = SMS_G_System_NETWORK_DRIVERS.ResourceID 
 WHERE SMS_G_System_NETWORK_DRIVERS.DriverVersion = '6.0.6001.18000'

So, if you’re someone who’s looking to get the Network Adapter Driver Versions inventoried by Configuration Manager, I hope you find this useful. And as always, be careful when modifying these MOF files. If you modify them, first verify the size of a typical client's complete hardware inventory and make sure it is acceptable for your networking environment. Then, test the new file in a test lab before replacing the default MOF files in production.

IMPORTANT: Using the example above works in my lab, however information in this post is provided "AS IS" with NO Warranties, or Support.

Vinay Pamnani | Support Engineer