a. Re-register all of the dlls and recompile the .mofs in
the wbem folder and re-registering WMI Service and Provider. You can use the
following script by saving to txt file then renaming to .bat and running from
command prompt with admin right and changing focus to following directory:
C:\Windows\System32\Wbem.
@echo off
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s
b. Reboot
the machine and test WMI
Next, check
the repository for consistencies:
For Windows Vista, Windows
7, Windows Server 2008, and Windows Server 2008 R2, you can run winmgmt /verifyrepository from a command prompt.
For Older OS like Windows XP and Windows Server 2003 run: WmiDiag tool with the checkconsistency option. For example: WmiDiag checkconsistency
For Older OS like Windows XP and Windows Server 2003 run: WmiDiag tool with the checkconsistency option. For example: WmiDiag checkconsistency
If repository is found to be
inconsistent:
a. For
Vista and newer, run from elevated command prompt:
Winmgmt
/salvagerepository
Note this command will take the content of the
inconsistent repository and merge it into the rebuilt repository if it is
readable
If the above doesn’t work,
then run:
Winmgmt /resetrepository
Note this will reset repository to the initial
state when the OS was first installed
For Windows XP and
Windows Server 2003, there are no built in switches to rebuild the
Repository, so you must do it manually.
Warning: Rebuilding the WMI
repository has resulted in some 3rd party products not working until their
setup is re-run & their MOF re-added back to the repository.
If /salvagerepository or
/resetrepository does not resolve the issue, then manually rebuild repository:
- Change startup type to Window Management
Instrumentation (WMI) Service to disabled
- Stop the WMI Service; you may need to stop IP Helper
Service first or other dependent services before it allows you to stop WMI
Service
- Rename the repository folder:
C:\WINDOWS\system32\wbem\Repository to Repository.old
- Open a CMD Prompt with elevated privileges
- CD windows\system32\wbem
- for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s
- Set the WMI Service type back to Automatic and start
WMI Service
- cd /d c:\ ((go to the root of the c drive, this
is important))
- for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s
- Reboot the server
https://blogs.technet.microsoft.com/askperf/2011/08/05/suggested-hotfixes-for-wmi-related-issues-on-windows-platforms-updated-august-9th-2013/
No comments:
Post a Comment