I'm trying to run the command `Get-WmiObject -ClassName Cim_logicaldevice` on my Windows Server 2012 virtual machine. While it gets some output, I also receive an error message at the end. Here's the output I see:
```
LastErrorCode :
Manufacturer : (Standard system devices)
Name : System CMOS/real time clock
PNPClass : System
PNPDeviceID :
PowerManagementCapabilities :
PowerManagementSupported :
Present : True
Service :
Status : OK
StatusInfo :
SystemCreationClassName : Win32_ComputerSystem
SystemName : SystemName1
PSComputerName : SystemName1
```
Then it gives this error:
```
Get-WmiObject : Generic failure
At line:1 char:1
+ Get-WmiObject -ClassName Cim_logicaldevice
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
```
Can anyone help me figure out what's going wrong and how to fix it?
2 Answers
We might need a bit more detail on the error. You can check additional error properties with the command:
```
$error[0]
```
Or use `get-error` if you have a newer version of PowerShell. This might give you clearer insights into what's going wrong.
Have you tried running these alternative commands to see if they produce the same error?
```
Get-CimInstance cim_logicaldevice
pnputil.exe /enum-devices
```
This might help narrow down the issue you're facing.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures