question

AlexS-1806 avatar image
0 Votes"
AlexS-1806 asked RichMatheisen-8856 commented

PowerShell unable to pull driver information using Get-CimInstance

I'm trying to to pull driver information from all the computers across our network but am having an issue where some throw an error. The command I'm running is this:

Get-CimInstance Win32_PnPSignedDriver | Where-Object DeviceName -eq "drivername" | Select-Object DriverVersion

And the error some computers throw is this:

  • Get-CimInstance Win32_PnPSignedDriver | Where-Object DeviceName -eq " ...

  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  • CategoryInfo : NotSpecified: (root\cimv2:Win32_PnPSignedDriver:String) [Get-CimInstance], CimException

  • FullyQualifiedErrorId : HRESULT 0x800706be,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand

Even if I simplify the command down to Get-CimInstance Win32_PnpSignedDriver I still get the same error. The following commands work just fine:

Get-CimInstance Win32_ComputerSystem
Get-CimInstance Win32_Process
Get-CimInstance CIM_LogicalDevice
Get-WmiObject win32_PnpSignedDriver

So it seems to be specific to the combination of Get-CimInstance and Win32_PnPSignedDriver. I've tried to rebuild the wmi repository using the following:

winmgmt /verifyrepository
Winmgmt /salvagerepository

But they don't report anything wrong and don't fix the issue. I've also tried to manually rebuild it with command prompt using the following:

sc config winmgmt start= disabled
net stop winmgmt
cd %windir%\system32\wbem
for /f %s in ('dir /b .dll') do regsvr32 /s %s
wmiprvse /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %s in ('dir /b
.mof') do mofcomp %s
for /f %s in ('dir /b *.mfl') do mofcomp %s

But no luck. The version of PowerShell on a computer that works and a computer that throws the error are the same. Any ideas on what might be going on?



windows-server-powershell
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Do you get the same result using Get-WMIObject?

Unfortunately, that 0x800706be error code is one that usually means something along the line of "oops! something went wrong and I don't know what to do".

You may get more information by adding the -Verbose switch to the cmdlet.




0 Votes 0 ·

0 Answers