Ir al contenido principal

Windows | INVALID CLASS ERROR | CMD | SYSTEMINFO | DRIVERS | WMI | Windows Management Instrumentation service | Clase no valida | Cómo reparar WMI

 Windows | INVALID CLASS ERROR | CMD | SYSTEMINFO | DRIVERS

Error cuando ejecuto aplicaciones o en el sistema Operativo:

System.Management.ManagementException Invalid class

Se debe realizar lo siguiente:


Inicie el complemento WMI MMC en Inicio -> Ejecutar -> luego ingrese WMIMGMT.MSC

Haga clic con el botón derecho en Control WMI (local) y haga clic en Propiedades

WMI 1: wmimgmt.msc

Si WMI funciona correctamente, mostrará Buenas propiedades. Si ve una clase no válida,  entonces su WMI no está funcionando correctamente.

Solución de problemas:

Abrir cmd y ejecutar:

sfc /scannow

DISM /Online /Cleanup-Image /RestoreHealth

Winmgmt.exe /standalonehost

Winmgmt.exe /resetrepository

winmgmt /resyncperf


Una vez terminado, revise WMIMGMT.MSC para ver si está completando las Propiedades correctamente.

Bien


https://techcommunity.microsoft.com/t5/ask-the-performance-team/wmidiag-2-2-is-here/ba-p/375642

Windows Management Instrumentation







C:\WINDOWS\System32\wbem\Repository and delete its contents.


Opción por comandos:

Ejecute el siguiente script en la máquina cliente que está generando los errores de corrupción de WMI. Vuelve a compilar todos los archivos .mof WMI que se encuentran en la carpeta% windir% \ System32 \ Wbem \ Repository.

Crear un bat: copia y pega en un bloc de notas y luego guarda como WMI.bat y ejecuta como administrador.

@ECHO OFFsc config winmgmt start= auto

reg add HKLM\SOFTWARE\Microsoft\Ole /v EnableDCOM /t REG_SZ /d “Y” /f
reg add HKLM\SOFTWARE\Microsoft\Ole /v LegacyAuthenticationLevel /t REG_DWORD /d “2” /f
reg add HKLM\SOFTWARE\Microsoft\Ole /v LegacyImpersonationLevel /t REG_DWORD /d “3” /f

reg delete HKLM\SOFTWARE\Microsoft\Ole /v DefaultLaunchPermission /f
reg delete HKLM\SOFTWARE\Microsoft\Ole /v MachineAccessRestriction /f
reg delete HKLM\SOFTWARE\Microsoft\Ole /v MachineLaunchRestriction /f

NET STOP SharedAccess

NET STOP winmgmt

CD %WINDIR%\System32\Wbem\Repository
DEL /F /Q /S %WINDIR%\System32\Wbem\Repository\*.*
CD %WINDIR%\system32\wbem

REGSVR32 /s %WINDIR%\system32\scecli.dll
REGSVR32 /s %WINDIR%\system32\userenv.dll

MOFCOMP cimwin32.mof
MOFCOMP cimwin32.mfl
MOFCOMP rsop.mof
MOFCOMP rsop.mfl
FOR /f %%s IN (‘DIR /b /s *.dll’) DO REGSVR32 /s %%s
FOR /f %%s IN (‘DIR /b *.mof’) DO MOFCOMP %%s
FOR /f %%s IN (‘DIR /b *.mfl’) DO MOFCOMP %%s
MOFCOMP exwmi.mof
MOFCOMP -n:root\cimv2\applications\exchange wbemcons.mof
MOFCOMP -n:root\cimv2\applications\exchange smtpcons.mof
MOFCOMP exmgmt.mof

rundll32 wbemupgd, UpgradeRepository

NET STOP Cryptsvc
DEL /F /Q /S %WINDIR%\System32\catroot2\*.*
DEL /F /Q C:\WINDOWS\security\logs\*.log
NET START Cryptsvc

cd c:\windows\system32
lodctr /R
cd c:\windows\sysWOW64
lodctr /R

WINMGMT.EXE /RESYNCPERF

msiexec /unregister
msiexec /regserver
REGSVR32 /s msi.dll

NET START winmgmt
NET START SharedAccess

  • Ejecute los siguientes comandos en un símbolo del sistema elevado en la máquina cliente que está generando los errores de corrupción de WMI. Esta es una forma alternativa de restablecer el repositorio de WMI al estado inicial cuando se instaló el sistema operativo por primera vez:

          Winmgmt.exe / standalonehost
          Winmgmt.exe / resetrepository

          Winmgmt.exe / salvagerepository

Comentarios