Score:0

PowerShell unable to pull driver information using Get-CimInstance

br flag

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?

Davidw avatar
in flag
It seems like the problem is not with the commands themselves, but something with those computers?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.