Fix WMI Errors
Log In or Register to download the BES file, and more.

0 Votes

Description

Created By: Martin Carnegie
Created: Nov 5, 2013
Comments:
NOTE: Please do testing of this fixlet before using in production as this could cause further issues with WMI!

This script contains two actions that can be used to fix WMI errors on Windows systems.

WMI Simple should be the first one used as it does not impact the system that much and seems to fix most issues.

WMI Advanced should only be used if the WMI Simple does not fix the issue. This will require a reboot

Both wmi_simple and wmi_advanced were provided from a source at Microsoft, but I am unable to find that source.


Property Details

ID3652
StatusBeta - Preliminary testing ready for more
TitleFix WMI Errors
DomainBESC
CategoryTroubleshooting
Download Size0
Sourcemartin@zaazee.ca
Source SeverityRepair WMI on Windows systems
Source Release Date11/5/2013 12:00:00 AM
KeywordsRepair WMI Windows
Added by on 11/5/2013 11:30:33 AM
Last Modified by on 1/20/2015 7:32:55 AM
Counters 2714 Views / 16 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 0 ratings. ** Log In or Register to add your rating.

Relevance

Used in 13 fixlets and 3 analyses   * Results in a true/false
Show indented relevance
name of operating system contains "Win"
Used in 1 fixlet   * Results in a true/false
Show indented relevance
not exists wmi | true

Actions

Action 1 (default)

Action Link Click here to deploy WMI Simple (Recommended).
Script Type BigFix Action Script
// WMI Simple
delete __creatfile
delete wmi_simple.bat

createfile until __END

cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /resyncperf
winmgmt /salvagerepository
for /f %%s in ('dir /b *.mof *.mfl') do mofcomp %%s

__END

copy __createfile wmi_simple.bat

waithidden cmd.exe /c wmi_simple.bat > {value of variable "temp" of environment}\wmi_simple.log 2>&1
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.

Action 2

Action Link Click here to deploy WMI Advanced.
Script Type BigFix Action Script
// WMI Advanced
delete __creatfile
delete wmi_advanced.bat

createfile until __END

net stop winmgmt
c:
cd %systemroot%\system32\wbem
rd /S /Q repository
regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\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
echo DONE - you must reboot

__END

copy __createfile wmi_advanced.bat

waithidden cmd.exe /c wmi_advanced.bat > {value of variable "temp" of environment}\wmi_advanced.log 2>&1

//According to the MS script, the system should be restarted after the script is executed.
action requires restart
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!
thetick -
With the relevance I put in here, it should only be relevant to systems that have an issue with WMI. If you are looking for the specific errors, you could do this with a web report. I created a blog on this that has the information for the web report (pretty simple). http://blog.gulfsoft.com/2013/11/repairing-wmi-errors-on-windows-systems.html Hope that answers your question.
jgstew -
Is there a good way to know that WMI may have errors that require fixing?