Had several systems which had wmi issue in doing client /application installation.This is most common issue which we face if something happens to the system.To get solved,use the script which can be run remotely using psexec tool. http://blogs.technet.com/b/configmgrteam/archive/2009/05/08/wmi-troubleshooting-tips.aspx
Note : The below script tested only on Windows XP ,not tested on higher versions like Windows 7
Download the psexec tool from Microsoft .Here are the basic instruction in doing it.
1.copy the psexec.exe tool on to new folder (G:\script) and create 3 new files(wmifix.bat,computers.txt and run.bat).Each file script has given below.
wmifix:
@echo off
REM WMI Repair
Title WMI Repair script running on the client machines%windir%\system32\wbem\winmgmt /clearadap
%windir%\system32\wbem\winmgmt /kill
%windir%\system32\wbem\winmgmt /unregserver
%windir%\system32\wbem\winmgmt /regserver
%windir%\system32\wbem\winmgmt /resyncperfnet stop winmgmt /y
REM if exist %windir%\system32\wbem\repository.old rmdir /s /q %windir%\system32\wbem\repository.old
REM ren %windir%\system32\wbem\repository repository.oldregsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.dllfor /f %%s in ('dir /b /s %windir%\system32\wbem\*.dll') do regsvr32 /s %%s
for /f %%s in ('dir /b /s %windir%\system32\wbem\*.mof') do mofcomp %%s
for /f %%s in ('dir /b %windir%\system32\wbem\*.mfl') do mofcomp %%snet start winmgmt
%windir%\system32\wbem\wmiprvse /regserver
run.bat
@echo off
cd G:\script
G:
psexec @computers.txt -c G:\script\wmifix.bat
computers.txt
Add list of computers to the txt file which you have trouble.
Use the above script to fix wmi issues on computers,if that doesnt repair,remove the bold letters REM and try.this will delete the repository and recreates it for you to work wmi correctly.
more information about troubleshooting can be found from http://blogs.technet.com/configmgrteam/archive/2009/05/08/wmi-troubleshooting-tips.aspx
16 Comments
Thanks for your swift reponse. This report is for SCCM 2012 environment but we are using 2007 currently. Do you have similar kind of report for SCCM 2007 version.
you will have to install client health status reporting tool to get such information.By default,there is no such info you get from CM07 and only possible things is to get,how many clients active,inactive,obsolete etc.
Do you have any script or sccm report which can tell me which clients are healthy, which are not healthy with the reason and which clients have WMI issues.
We are facing issues on many machines where RAP is blank. Just want to automate things.
have you tried this report ? http://eskonr.com/2014/05/sccm-configmgr-2012-ssrs-dashboard-client-health-summary-report/
Hi Eswar,
I have tried using this script and the result shows as below: Does this mean the Script ran successfully and WMI repair was done or not, kindly suggest.
The following services are dependent on the Windows Management Instrumentation s
ervice.
Stopping the Windows Management Instrumentation service will also stop these ser
vices.
Intel(R) Rapid Storage Technology
Dell ControlPoint System Manager
Dell ControlPoint Button Service
The Intel(R) Rapid Storage Technology service is stopping..
The Intel(R) Rapid Storage Technology service was stopped successfully.
The Dell ControlPoint System Manager service is stopping.
The Dell ControlPoint System Manager service was stopped successfully.
The Dell ControlPoint Button Service service is stopping.
The Dell ControlPoint Button Service service was stopped successfully.
The Windows Management Instrumentation service is stopping.
The Windows Management Instrumentation service was stopped successfully.
The system cannot find the file ædir.
The system cannot find the file ædir.
The system cannot find the file ædir.
The requested service has already been started.
More help is available by typing NET HELPMSG 2182.
wmifix.bat exited on \\Machine Name with error code 0.
Regards,
Mikey
from the above snippet,script ran with exit code 0 successfully.Did u see any mof files complied on computer ?
I think it will work on a 2008 server but frankly I didn't try it.
I'll let you know if I give it a try.
Thanks.
Hi Eswar,
Thank you for the valuable info.
Any updates for Server 2008 and newer?
Thanks,
Tolga
I cont find reason why it wouldnt work on server 2008 ? did you try it on any server ?
Hi Ismail,
Please do check your DP and MP and also check if machine's polocy is working fine.
I dealt the same type of issue in my environment and there was a issue with DP.
hi eswar,
i have distribute one package to 2 test pc. the package is working fine in one pc.i have tried to open the app in another test pc.. it will loading and disappeared. i do not know y dis was happened. and also i have tried to repair the app in ARP. it throws an error msg "Fatal error during installation".
could u plz send reply ASAP?
Hey koneti,
how can I add a "safe sender" entry via script or is there a
command line I can use to do it? I am looking for something
sprcifically unrelated to the UI entry method, something scriptable
that I can wrap and deploy to remote workstations in my enterprise.
Hi,
I think you are talking about Junk mails in Outloook ? you can do this Via GPO rather going for scripts .Look at technet article http://technet.microsoft.com/en-us/library/cc179183.aspx
hi eswar,
Hope you are doing gud.. I want to Create a script to configure settings in Internet Explorer.
The option “Automatically detect settings” should be blank (not selected) for all users and for the default user.
is this possible to create VB Script for that?
can i have any links ?
Hi eswar.
I am working on SMS environment. We have some of the clients hasn't reporting to sms server for last 30 days.i found the error is SMS agent issue. Is there any Script for repair the sms agent service?. and one more thing is that when i am trying to ping the machines with ipaddress ,its resolving another machine.
If u have any script for repair sms agent in Sms client,provide me ASAP.
thanks ,
Ismail
Hi Syed,
How do you say issues with SMS agent ? and for Ip address conflits,you have DNS issue .Please do scavenging on DNS server .BEfore that verify if single IP address is assiged to multiple computers (you should see many entries in DNS) as i saw this many times in my environment.