Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a list of devices with missing drivers using powershell

This is on a Windows XP pro System (yeah I know old OS) I have been searching for a way to get a list of all devices that do not have drivers installed, or there are problems with the drivers in use.

I have tried

  $foo = Get-WmiObject Win32_PNPEntity | Where-Object{$_.ConfigManagerErrorcode -ne 0}

The problem with this, is it does not seem to get all exceptions.
For instance, a HP laptop that has a finger print scanner shows in device manager as other device - USB Device. This was not detected using the one liner I listed.

is there a way to get an array of the missing drivers using powershell?

like image 306
Radagast Avatar asked Aug 31 '25 04:08

Radagast


1 Answers

#For formatting:
    $result = @{Expression = {$_.Name}; Label = "Device Name"},
              @{Expression = {$_.ConfigManagerErrorCode} ; Label = "Status Code" }

#Checks for devices whose ConfigManagerErrorCode value is greater than 0, i.e has a problem device.
Get-WmiObject -Class Win32_PnpEntity -ComputerName localhost -Namespace Root\CIMV2 | Where-Object {$_.ConfigManagerErrorCode -gt 0 } | Format-Table $result -AutoSize

Error Codes in Windows Device Manager :- https://support.microsoft.com/en-us/kb/310123 Win32_PNP Entity Class : https://msdn.microsoft.com/en-us/library/aa394353(v=vs.85).aspx

like image 171
ArNumb Avatar answered Sep 02 '25 21:09

ArNumb