Radagast
Radagast

Reputation: 1096

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?

Upvotes: 3

Views: 26796

Answers (3)

not2qubit
not2qubit

Reputation: 17077

See my more complete example here.

Get-WmiObject Win32_PNPEntity | Where-Object{[string]::IsNullOrEmpty($_.ClassGuid) } | Select-Object Name,Present,Status,DeviceID | Sort-Object Name

Upvotes: 1

ArNumb
ArNumb

Reputation: 317

#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

Upvotes: 3

justinf
justinf

Reputation: 1298

I did this when i had some devices that where not being picked up by my script , give it a try and see if it detects your devices.

$foo = Get-WmiObject Win32_PNPEntity | Where-Object{$_.Availability -eq 11 -or $_.Availability -eq 12}

Upvotes: 2

Related Questions