Home > 3rd Party Tools > Web Remote Console v3.2.1 Rebuild WMI

Web Remote Console v3.2.1 Rebuild WMI


Here is another button for Ron Crumbaker’s Web Remote Console v3.21. This button will rebuild the WMI repository on the remote device. Be sure to note the psexec.exe reference in the “Remote$” share.

‘———————————————————————————-
‘This button will rebuild the WMI repository
‘———————————————————————————-
Sub Btnl35_OnClick
on error resume Next
Dim CompName, WShell, strCommand

CompName = trim(document.frmMain.txtValue.value)
Set WShell = CreateObject(“WScript.Shell”)
strCommand = “\\SERVERNAME\remote$\psexec.exe \\” & CompName & ” -s /accepteula \\SERVERNAME\remote$\WMIFixWORebuild.cmd

if len(trim(CompName)) = 0 Then
msgbox “Please type a Machine Name.”,,”Uninstall SCCM Client”
Else
Set objPing = GetObject(“winmgmts://” & ServerName & “/root/default:PingPoller”)
objPing.Ping CompName, “100”, “1”, PingResult
‘msgbox PingResult
if PingResult <> 0 then
msgbox “Machine did not respond to ping.”,,””
else
‘msgbox “This Function is Under Development…”

intReturn = wshell.Run(strCommand,0,false)
IF intReturn = 0 THEN
msgbox “The WMI repository has been rebuilt.”
ELSE
msgbox “Access Denied with Error: ” & intReturn
END IF

end if
end if

End SUb

‘———————————————————————————-

 

***WMIFixWORebuild.cmd (create the file and place in the Remote$ share)***

net stop winmgmt /y
rename %windir%\System32\Wbem\Repository %windir%\System32\Wbem\Repository_bad
net start winmgmt

rundll32 wbemupgd, UpgradeRepository

cd /d %windir%\system32\wbem
for %%i in (*.dll) do RegSvr32 -s %%i
del wbemtest.bak
rename wbemtest.exe wbemtest.bak
for %%i in (*.exe) do %%i /RegServer
rename wbemtest.bak wbemtest.exe

————————————————————————————————

Advertisements
Categories: 3rd Party Tools
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: