How to fix Get-Netadapter : Invalid class

Learn how to resolve the ‘Get-NetAdapter: Invalid class’ error in PowerShell. Follow these steps to troubleshoot and fix network adapter issues on Windows systems

The error message “Get-NetAdapter: Invalid class” typically occurs when you’re trying to run the PowerShell cmdlet Get-NetAdapter on a system where the cmdlet is not available or when it’s being used in an unsupported context. Get-NetAdapter is used to retrieve network adapter information on Windows systems, but it’s only available on Windows 8 and later versions, as well as Windows Server 2012 and later.

Here are some steps you can take to fix this error:

  1. Disable and stop the WMI service
sc config winmgmt start= disabled
net stop winmgmt
  1. Run the following commands
 Winmgmt /salvagerepository %windir%\System32\wbem
 Winmgmt /resetrepository %windir%\System32\wbem
  1. Re-enable the WMI service and reboot
 sc config winmgmt start= auto

If the problem remains, then try the following steps to rebuild the repository:

  1. Disable and stop the WMI service
 sc config winmgmt start= disabled     (note that there is a blank between '=' and 'disabled')
 net stop winmgmt
  1. Rename the repository folder (located at %windir%\System32\wbem\repository) to repository.old
  2. Re-enable the WMI service

sc config winmgmt start= auto

  1. Reboot the machine.

If the above doesn’t work try chkdsksfc, and dism. Additionally, you can try a Windows Repair Install.

Leave a Comment