Powershell Win32_Classes Error : Invalid Class

Many times you have seen this error when you try to use classes in Get-WMIObject and get error "invalid class" as attached below.


And you will many thing to troubleshoot it and sometimes you will be messed up with your operating system. Here is the solution which i use always and it works for me.

1. Login to the system which is showing this error.
2. Open Services ( as an administrator).
3. Check for "WMI Performance Adapter". If it is stopped, then start it.
4. Open Command Prompt as an administrator.
5. Run winmgmt /salvagerepository. If it shows any error and shows non-consistent.
6. Run winmgmt /resetrepository to reset the repository.
7. It could show error on first run, like below attached image.
8. Please run it again and it will fix it.

Thank you

0 comments:

Post a Comment