Link to home
Start Free TrialLog in
Avatar of ISCS_HW
ISCS_HW

asked on

Repair WMI Remotely

I am trying to repair WMI on client machines remotely. I have this set so that I will run PSEXEC (from the PS Tools suite from SysInternals) on the remote machine, with my domain admin account. It runs a batch file named CALL.BAT (attached), which calls the batch file FIXWMI.BAT (attached). I do this because if I ran the FIXWMI.BAT from the PSEXEC utility, it failed with access denied. When I run PSEXEC on the CALL.BAT file, it runs through a bit better, but seems to want a response from me when running the call c:\fixwmi.bat command in the CALL.BAT file.

Are there any ideas on how I may be able to fix the batch files, or how to repair WMI on a remote computer?
CALL.BAT
call c:\fixwmi.bat


FIXWMI.BAT
cmd /c echo y | net stop winmgmt
ren C:\WINDOWS\system32\wbem\Repository Repository.old
cmd /c net start winmgmt

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ggefter
ggefter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try also running the script as a STARTUP script and not a login script.  If it runs as a STARTUP script, I believe it runs under the local SYSTEM account, which would have the rights that you need for the script to run.
Avatar of ISCS_HW
ISCS_HW

ASKER

ggefter:

II tried the rundll32 to portion to update WMI, I will get back to you on if it works after the computer is restarted. I don't want to have to locally login to each system to fix the issue, as the broken systems are in multiple countries.

kcoect:

I don't want to set this as a startup, as I don't want it to be "repaired" every time someone logs in to the machine.
Avatar of johnb6767
PsExec....
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

psexec \\remotepc -c fixwmi.bat

Just make sure that psexec is in the same directory as the .bat file.....

-c copies it to the \\remotepc and executes it on the target
Avatar of ISCS_HW

ASKER

The batch files are on the remote PC.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ISCS_HW

ASKER

see screen shot of what is happening
WMI.jpg
"The batch files are on the remote PC."

psexec \\remotepc "C:\Path\To\fixwmi.bat"

Or just launch a remote command shell......

psexec \\remotepc cmd.exe

Then just navigate it locally......
Why not just use.....

psexec \\remotepc rundll32 wbemupgd, UpgradeRepository
Dont wanna logon to each pc?

psexec @C:\PCNames.TXT -d rundll32 wbemupgd, UpgradeRepository

C:\PCNames.txt is self explanatory, just populate the ones you wanna hit......

Avatar of ISCS_HW

ASKER

I am trying that now as mentioned by ggefter

I am also trying re-registering the components you suggested from http://windowsxp.mvps.org/repairwmi.htm

I will let you know how each works.
Why have cmd /c?


FIXWMI.BAT
echo y | net stop winmgmt
ren C:\WINDOWS\system32\wbem\Repository Repository.old
net start winmgmt
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ISCS_HW

ASKER

The fix by ggefter worked for some of my workstations, and the others were fixed thanks to johnb6767. The script by AmazingTech was also helpful so I did not need to create my own script for this.