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?
#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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With