Searching for Drivers in MDT
Today I had an interesting question. Someone wanted to be able to see all the PnP IDs of the imported drivers so he could easily check if a specific device was already supported. While this information is available in the properties of each driver, its not shown in a column of the workbench. And even if it would be available as a column, it wouldn’t be easy to read as a single driver typically supports a whole bunch of PNP IDs.
Now as everything in MDT is available via PowerShell, it should be possible to get this information. Let’s dig through this a bit.
First we open a PowerShell prompt, load the MTD Module and mount the Deployment Share
1 2 |
Add-PSSnapIn Microsoft.BDD.PSSnapIn New-PSDrive -Name "MDT" -PSProvider MDTProvider -Root "C:\MyDeploymentShare" |
The Drivers are found in the “Out-of-Box Drivers” folder on the deployment share. Let’s just list them for now. The Recurse parameter will just give us all drivers in all subfolders as well.
1 |
Get-ChildItem -path "MDT:\Out-of-Box Drivers" –Recurse |
as you can see, I’ve only imported a few drivers into the deployment share for demonstration purposes. The result, is also not really helpful, as it returns a list of Driver Names with version and also all Folder names. To get rid of the folders and only list the Drivers, we could add a filter that removes them like
1 |
Get-ChildItem -path "MDT:\Out-of-Box Drivers" –Recurse | where {!$_.PSIsContainer} |
But we want it functional for now, not pretty . A single driver might cover different models or maybe MDT picked the wrong name etc. Let’s have a look on the properties of one of the Driver
1 |
Get-ItemProperty "MDT:\Out-of-Box Drivers\Intel Net E1K5132.INF 11.6.92.0" |
OK, that’s a bit better. We see properties like “Manufacturer”, “Version”, “Platform”, “Class”, “OSVersion” and “PNPId”. Most of them are also shown in the Workbench, but not all. Now back to the first query and return the result as a table with some more properties (Yeah, still with folders, ignore them for now)
1 |
Get-ChildItem -Path "MDT:\Out-of-Box Drivers" -Recurse | Format-Table -Property Manufacturer, Name, Version, PNPId |
Hm, getting better, but still not good. Let’s filter for all Intel Network Drivers and remove a couple columns
1 |
Get-ChildItem -Path "MDT:\Out-of-Box Drivers" -Recurse | Where {$_.Class -eq "Net" -and $_.Manufacturer -like "*Intel*"} | Format-Table -Property Name, PNPId |
OK, and the same way, we can now filter for a specific device. Let’s say an Intel 82567LM-3 Gigabit Adapter with Device ID “PCIVEN_8086&DEV_10DE&SUBSYS_10DE8086”.
1 |
Get-ChildItem -Path "MDT:\Out-of-Box Drivers" -Recurse | where {$_.PNPId -like "*PCI\VEN_8086&DEV_10DE&SUBSYS_10DE8086"*} | ft -Property Name, Platform, OSVersion |
And as we see, we already have a couple drivers imported that will support this device on different Platforms and OS Versions.
There is still some room for improvement. We could encapsulate this in a custom function, maybe also optionally supply a selection profile etc. But that has to wait until I find some sparetime (or a PowerShell magician who probably codes this in a few minutes). Now back to some coding on the Web FrontEnd, the next release is more than overdue but the monitoring grew a bit more than expected.
Recent Comments