Today I run into problem with WMI registrations on few servers. Even though namespace root\Citrix was available, there were no classes.
Below is simple batch script that should be able to solve most WMI-related issues:
:: Remove Repository
Net Stop winmgmt
RmDir /s /q "%WinDir%\System32\WBEM\Repository"
Net Start winmgmt
:: Register core libraries
Regsvr32 /n /I /s "%WinDir%\system32\userenv.dll"
regsvr32 /n /I /s "%WinDir%\system32\scecli.dll"
:: Compile Windows WMI
If Exist "%WinDir%\System32\WBEM" (
For /f "usebackq tokens=*" %%X IN (`Dir /b "%WinDir%\System32\WBEM\*.dll"`) Do (
Call %S4_Lib%\SCRIPT_RUNLOG RegSvr32.exe /s "%WinDir%\System32\Wbem\%%X"
)
For /f "usebackq tokens=*" %%X IN (`Dir /b "%WinDir%\System32\WBEM\*.mof"`) Do (
Call %S4_Lib%\SCRIPT_RUNLOG MofComp.exe "%WinDir%\System32\Wbem\%%X"
)
For /f "usebackq tokens=*" %%X IN (`Dir /b "%WinDir%\System32\WBEM\*.mfl"`) Do (
Call %S4_Lib%\SCRIPT_RUNLOG MofComp.exe "%WinDir%\System32\Wbem\%%X"
)
)
:: Compile Citrix WMI
If Exist "%ProgramFiles%\Citrix\System32\Citrix\WMI" (
For /f "usebackq tokens=*" %%X IN (`Dir /b "%ProgramFiles%\Citrix\System32\Citrix\WMI\*.dll"`) Do (
Call %S4_Lib%\SCRIPT_RUNLOG RegSvr32.exe /s "%ProgramFiles%\Citrix\System32\Citrix\WMI\%%X"
)
For /f "usebackq tokens=*" %%X IN (`Dir /b "%ProgramFiles%\Citrix\System32\Citrix\WMI\*.mof"`) Do (
Call %S4_Lib%\SCRIPT_RUNLOG MofComp.exe "%ProgramFiles%\Citrix\System32\Citrix\WMI\%%X"
)
For /f "usebackq tokens=*" %%X IN (`Dir /b "%ProgramFiles%\Citrix\System32\Citrix\WMI\*.fom"`) Do (
Call %S4_Lib%\SCRIPT_RUNLOG MofComp.exe "%ProgramFiles%\Citrix\System32\Citrix\WMI\%%X"
)
)
No comments:
Post a Comment