@echo off
%windir%system32wbemwinmgmt /clearadap
%windir%system32wbemwinmgmt /kill
%windir%system32wbemwinmgmt /unregserver
%windir%system32wbemwinmgmt /reserver
%windir%system32wbemwinmgmt /resyncperf
net stop winmgmt /y
if exist %windir%system32wbemrepository.old rmdir /s /q %windir%system32wbemrepository.old
ren %windir%system32wbemrepository repository.old
regsvr32 /s %systemroot%system32scecli.dll
regsvr32 /s %systemroot%system32userenv.dll
for /f %%s in (‘dir /b /s %windir%system32wbem*.dll’) do regsvr32 /s %%s
for /f %%s in (‘dir /b /s %windir%system32wbem*.mof’) do mofcomp %%s
for /f %%s in (‘dir /b %windir%system32wbem*.mfl’) do mofcomp %%s
net start winmgmt
%windir%system32wbemwmiprvse /regserver
Save above batch file as wmifix.bat and run with the PSexec.exe with below command line   psexec @list.txt -c c:scriptswmifix.cmd

List.txt
Add list of computers to the list.txt file which you have trouble.

 

Leave a Reply

Your email address will not be published. Required fields are marked *