2

I am trying to find a command line way to detect uninstalled drivers in device manager, I need a way to detect if there are items under "other devices" as shown below screen shot

otherdeices

Ritz
  • 1,193
  • 6
  • 15
  • 26

2 Answers2

2

Couple out of the box (mostly) options here;

Command Prompt (Admin)

C:\> wmic path win32_pnpentity where ConfigManagerErrorcode!=0 get * /format:list

Powershell

PS C:\> Get-WmiObject Win32_PNPEntity | where {$_.status -ne "OK"} | fl 

Using the properties from the above results, you can customise the output;

C:\> wmic path win32_pnpentity where ConfigManagerErrorcode!=0 get pnpclass,name,status /format:list
PS C:\> Get-WmiObject Win32_PNPEntity | where {$_.status -ne "OK"} | ft pnpclass,name,status -AutoSize

Note No pipe on the wmic example.

You can get more information about output formats using;

C:\> wmic path win32_pnpentity where ConfigManagerErrorcode!=0 get * /format /?

and

PS C:\> get-help format

Update:

In regards to listing specifically "uninstalled" devices (your post addressed both "other" and "uninstalled" devices, which are technically different), have a read of the microsoft class description for win32_pnpentity,

https://msdn.microsoft.com/en-us/library/aa394353(v=vs.85).aspx

Properties The Win32_PnPEntity class has these properties.

......

Other (1)

Unknown (2)

Running/Full Power (3)

...

Not Installed (11)

...

hmedia1
  • 5,552
  • 2
  • 22
  • 27
  • None of those answers actually address the question. As shown in OP picture those devices are not recognized on `status` as *not ok*. They can be either. – not2qubit May 11 '23 at 15:46
0

Here is the correct way to find problem devices that show up in Windows Device Manager with a question sign under "Other devices".

First thing to note is that these devices are not really problem devices, only that they have not been assigned a classGuid. The tricky part is that powershell doesn't seem to like empty ("") strings in the test, so you need to use the Null test: [string]::IsNullOrEmpty($_.ClassGuid),like this.

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

With Output:

Name              Present Status DeviceID
----              ------- ------ --------
                     True OK     HTREE\ROOT\0
Airoha_APP           True OK     BTHENUM\{8901DFA8-5C7E-4D8F-9F0C-C2B70683F5F0}_VID&0002054C_PID&0D58\7&2CE6D2A4&0&F84E17E86153_C00000000
Amazon Alexa         True OK     BTHENUM\{931C7E8A-540F-4686-B798-E8DF0A2AD9F7}_VID&0002054C_PID&0D58\7&2CE6D2A4&0&F84E17E86153_C00000000

PS. I leave it as an exercise to filter out the ROOT hub. Which is a kind way of saying I'm too lazy to do it myself.

For a slightly different list including Non present and/or with unknown status, try this:

Get-PnPDevice | Where-Object{[string]::IsNullOrEmpty($_.ClassGuid) } | Select-Object FriendlyName,Present,Status,DeviceID | Sort-Object FriendlyName
not2qubit
  • 14,531
  • 8
  • 95
  • 135